[compiler-rt] [test] Add an .exe suffix for unit test executables on MinGW
authorMartin Storsjö <martin@martin.st>
Sun, 23 Apr 2023 19:51:59 +0000 (22:51 +0300)
committerMartin Storsjö <martin@martin.st>
Tue, 25 Apr 2023 18:09:05 +0000 (21:09 +0300)
Previously, an .exe suffix was only added for MSVC configurations.

In practice, an .exe suffix is added implicitly by MinGW toolchains
if the output is a suffixless file name. However this can cause lots
of subtle build system confusion, when it's not generating the file it
expected.

Differential Revision: https://reviews.llvm.org/D149029

compiler-rt/cmake/Modules/AddCompilerRT.cmake

index 0452213..752ce2f 100644 (file)
@@ -508,7 +508,7 @@ function(add_compiler_rt_test test_suite test_name arch)
   set(output_dir "${output_dir}/${CMAKE_CFG_INTDIR}")
   file(MAKE_DIRECTORY "${output_dir}")
   set(output_bin "${output_dir}/${test_name}")
-  if(MSVC)
+  if(WIN32)
     set(output_bin "${output_bin}.exe")
   endif()