Use .lib suffix for Windows and .a for non-Windows
Details
Diff Detail
Event Timeline
Not sure if it is the portable way to do.
I see cmake/base-config-ix.cmake has set(CMAKE_STATIC_LIBRARY_SUFFIX_C ".lib"), but I can't find where the variable is used and not sure if we can use it in test/CMakefile.
test/builtins/CMakeLists.txt | ||
---|---|---|
20 ↗ | (On Diff #94321) | I think you want if (MSVC) here instead. Can we just ask CMake for the filename of the target and substitute that in? CMake already knows this platform-specific logic. If we can't do that, it's probably simplest to add is_msvc = @MSVC@ to lit.site.cfg.in and push this conditional path computation logic down into lit.cfg. We might need to pythonize the MSVC bool, though, or it'll come out as ON/OFF. |
test/builtins/Unit/lit.cfg | ||
34 | The correct filename is actually clang_rt.builtins-%s.lib, without the lib prefix. |
I tried to use the lib name from cmake/Module/AddCompilerRT.cmake : add_compiler_rt_runtime but no luck.
And I can't find where the suffix is set in compiler-rt project.
test/builtins/Unit/lit.site.cfg.in | ||
---|---|---|
7 | This might become the strings "ON", "", or "OFF", I'm not sure which. I'd rather follow the example of SANITIZER_CAN_USE_CXXABI and use pythonize_bool(MSVC) in test/builtins/CMakeLists.txt and @MSVC_PYBOOL@ here. |
There were enough issues with running lit tests on Windows that I went ahead and fixed them in a series of changes. We can close this.
The correct filename is actually clang_rt.builtins-%s.lib, without the lib prefix.