[libcxx-commits] [libcxx] 9fb2378 - [libcxx] [test] Merge the MinGW static/shared test config files (#111759)

via libcxx-commits libcxx-commits at lists.llvm.org
Wed Oct 9 23:13:50 PDT 2024


Author: Martin Storsjö
Date: 2024-10-10T09:13:47+03:00
New Revision: 9fb2378ad52927cafa918b51f2054c47108f2f24

URL: https://github.com/llvm/llvm-project/commit/9fb2378ad52927cafa918b51f2054c47108f2f24
DIFF: https://github.com/llvm/llvm-project/commit/9fb2378ad52927cafa918b51f2054c47108f2f24.diff

LOG: [libcxx] [test] Merge the MinGW static/shared test config files (#111759)

These were split in 0e8208eca1c316b7302de7803ab0d85a1dd77076, with the
only functional difference between them at the time being `--prepend_env
PATH=%{lib-dir}` in the static config and `--prepend_env
PATH=%{install-prefix}/bin` in the shared library config.

However this difference is unnecessary - the static library config
doesn't need any `--prepend_env` argument at all. Before
0e8208eca1c316b7302de7803ab0d85a1dd77076, both configurations used the
same config file, where the `--prepend_env` argument was unnecessary but
benign in the static case.

Reduce the unnecessary config duplication in this case, and return these
configs to using one single config file for both setups.

Added: 
    libcxx/test/configs/llvm-libc++-mingw.cfg.in

Modified: 
    libcxx/CMakeLists.txt

Removed: 
    libcxx/test/configs/llvm-libc++-shared-mingw.cfg.in
    libcxx/test/configs/llvm-libc++-static-mingw.cfg.in


################################################################################
diff  --git a/libcxx/CMakeLists.txt b/libcxx/CMakeLists.txt
index f1942e963ccc31..75c926f5432aea 100644
--- a/libcxx/CMakeLists.txt
+++ b/libcxx/CMakeLists.txt
@@ -131,11 +131,7 @@ option(LIBCXX_ENABLE_VENDOR_AVAILABILITY_ANNOTATIONS
 if (CMAKE_CXX_COMPILER_ID STREQUAL "GNU")
   set(LIBCXX_DEFAULT_TEST_CONFIG "llvm-libc++-shared-gcc.cfg.in")
 elseif(MINGW)
-  if (LIBCXX_ENABLE_SHARED)
-    set(LIBCXX_DEFAULT_TEST_CONFIG "llvm-libc++-shared-mingw.cfg.in")
-  else()
-    set(LIBCXX_DEFAULT_TEST_CONFIG "llvm-libc++-static-mingw.cfg.in")
-  endif()
+  set(LIBCXX_DEFAULT_TEST_CONFIG "llvm-libc++-mingw.cfg.in")
 elseif(WIN32) # clang-cl
   if (LIBCXX_ENABLE_SHARED)
     set(LIBCXX_DEFAULT_TEST_CONFIG "llvm-libc++-shared-clangcl.cfg.in")

diff  --git a/libcxx/test/configs/llvm-libc++-shared-mingw.cfg.in b/libcxx/test/configs/llvm-libc++-mingw.cfg.in
similarity index 92%
rename from libcxx/test/configs/llvm-libc++-shared-mingw.cfg.in
rename to libcxx/test/configs/llvm-libc++-mingw.cfg.in
index 8868f0cadd2aa2..01c4d58ca05f96 100644
--- a/libcxx/test/configs/llvm-libc++-shared-mingw.cfg.in
+++ b/libcxx/test/configs/llvm-libc++-mingw.cfg.in
@@ -1,5 +1,5 @@
 # This testing configuration handles running the test suite against LLVM's libc++
-# using a DLL with MinGW/Clang on Windows.
+# using either a DLL or a static library, with MinGW/Clang on Windows.
 
 lit_config.load_config(config, '@CMAKE_CURRENT_BINARY_DIR@/cmake-bridge.cfg')
 

diff  --git a/libcxx/test/configs/llvm-libc++-static-mingw.cfg.in b/libcxx/test/configs/llvm-libc++-static-mingw.cfg.in
deleted file mode 100644
index fb2f9065898a54..00000000000000
--- a/libcxx/test/configs/llvm-libc++-static-mingw.cfg.in
+++ /dev/null
@@ -1,25 +0,0 @@
-# This testing configuration handles running the test suite against LLVM's libc++
-# using a static library with MinGW/Clang on Windows.
-
-lit_config.load_config(config, '@CMAKE_CURRENT_BINARY_DIR@/cmake-bridge.cfg')
-
-config.substitutions.append(('%{flags}', ''))
-config.substitutions.append(('%{compile_flags}',
-    '-nostdinc++ -I %{target-include-dir} -I %{include-dir} -I %{libcxx-dir}/test/support'
-))
-config.substitutions.append(('%{link_flags}',
-    '-nostdlib++ -L %{lib-dir} -lc++'
-))
-config.substitutions.append(('%{exec}',
-    '%{executor} --execdir %T --prepend_env PATH=%{lib-dir} -- '
-))
-
-import os, site
-site.addsitedir(os.path.join('@LIBCXX_SOURCE_DIR@', 'utils'))
-import libcxx.test.params, libcxx.test.config
-libcxx.test.config.configure(
-    libcxx.test.params.DEFAULT_PARAMETERS,
-    libcxx.test.features.DEFAULT_FEATURES,
-    config,
-    lit_config
-)


        


More information about the libcxx-commits mailing list