Traverse-Research / ispc-downsampler

Image downsampler using a Lanczos filter implemented in ISPC
Other
11 stars 1 forks source link

build: Don't set ISPC target OS to the machine that currently runs the build script #4

Closed MarijnS95 closed 2 years ago

MarijnS95 commented 2 years ago

The CARGO_CFG_TARGET_OS environment variable should be used for this, as cfg!() represents the target the build.rs script was compiled for and will contain the wrong value when cross-compiling for a different target.

Empirical evidence suggests that it's not necessary to explicitly set target_os anyway since it is already conveyed in the TARGET triple environment variable. It's not passed directly to ispc but at least ispc-rs uses it to identify the architecture, and it should should be irrelevant when not linking against external libraries.