wasi-sdk
wasi-sdk copied to clipboard
-DCMAKE_TRY_COMPILE_TARGET_TYPE=STATIC_LIBRARY for compiler-rt
Not sure how you all build compiler-rt now, but thanks to https://stackoverflow.com/questions/53633705/cmake-the-c-compiler-is-not-able-to-compile-a-simple-test-program I found this elegant way to avoid a dependency cycle stemming from cmake's default configure step.
Got here from fixing https://github.com/NixOS/nixpkgs/pull/56555#discussion_r275133192
It looks like -DCMAKE_C_COMPILER_WORKS is set here:
https://github.com/CraneStation/wasi-sdk/blob/master/wasi-sdk.cmake#L32
Thanks for pointing that out -- -DCMAKE_C_COMPILER_WORDS is actually an old workaround for problems which have since been fixed properly. I submitted https://github.com/CraneStation/wasi-sdk/pull/20 to remove it.
As a quick update, it turns out removing the -DCMAKE_C_COMPILER_WORDS did break things, because I was getting files from previous builds when I was testing it. I'll try using -DCMAKE_TRY_COMPILE_TARGET_TYPE=STATIC_LIBRARY instead.
That appeared to have problems as well, that I didn't see in my local builds. See #20 for details.
This was originally landed in #20 however as detailed in that issue, it caused various problems, so we backed it out. If anyone is interested in investigating, please reopen!