[PATCH] D31742: [Builtins] Fix lit test setup for Windows

Reid Kleckner via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Apr 6 17:28:20 PDT 2017


rnk added inline comments.


================
Comment at: test/builtins/CMakeLists.txt:20
   set(BUILTINS_TEST_TARGET_ARCH ${arch})
+  if (WIN32 AND NOT MINGW AND NOT CYGWIN)
+    set(BUILTINS_STATIC_LIB_SUFFIX ".lib")
----------------
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.


================
Comment at: test/builtins/Unit/lit.cfg:28
+suffix = get_required_attr(config, "builtins_lib_name_suffix")
+base_lib = os.path.join(config.compiler_rt_libdir, "libclang_rt.builtins-%s"
+    % config.target_arch) + suffix
----------------
The correct filename is actually `clang_rt.builtins-%s.lib`, without the `lib` prefix.


https://reviews.llvm.org/D31742





More information about the llvm-commits mailing list