[libcxx-commits] [PATCH] D155562: [libcxx] [test] Use -fms-runtime-lib= for picking the CRT to use
Martin Storsjö via Phabricator via libcxx-commits
libcxx-commits at lists.llvm.org
Wed Aug 2 13:54:17 PDT 2023
mstorsjo updated this revision to Diff 546599.
mstorsjo added a comment.
Rebase
Repository:
rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D155562/new/
https://reviews.llvm.org/D155562
Files:
libcxx/test/CMakeLists.txt
libcxx/test/configs/llvm-libc++-shared-clangcl.cfg.in
libcxx/test/configs/llvm-libc++-shared-no-vcruntime-clangcl.cfg.in
libcxx/test/configs/llvm-libc++-static-clangcl.cfg.in
Index: libcxx/test/configs/llvm-libc++-static-clangcl.cfg.in
===================================================================
--- libcxx/test/configs/llvm-libc++-static-clangcl.cfg.in
+++ libcxx/test/configs/llvm-libc++-static-clangcl.cfg.in
@@ -5,10 +5,10 @@
config.substitutions.append(('%{flags}', '--driver-mode=g++'))
config.substitutions.append(('%{compile_flags}',
- '-nostdinc++ -I %{include} -I %{target-include} -I %{libcxx}/test/support -D_CRT_SECURE_NO_WARNINGS -D_CRT_NONSTDC_NO_WARNINGS -D_CRT_STDIO_ISO_WIDE_SPECIFIERS -DNOMINMAX' + config.dbg_include
+ '-fms-runtime-lib=' + config.fms_runtime_lib + ' -nostdinc++ -I %{include} -I %{target-include} -I %{libcxx}/test/support -D_CRT_SECURE_NO_WARNINGS -D_CRT_NONSTDC_NO_WARNINGS -D_CRT_STDIO_ISO_WIDE_SPECIFIERS -DNOMINMAX' + config.dbg_include
))
config.substitutions.append(('%{link_flags}',
- '-nostdlib -L %%{lib} -llibc++ -l%s -l%s -loldnames' % (config.crt_lib, config.cxx_lib)
+ '-nostdlib -L %{lib} -llibc++ -l' + config.cxx_lib
))
config.substitutions.append(('%{exec}',
'%{executor} --execdir %T -- '
Index: libcxx/test/configs/llvm-libc++-shared-no-vcruntime-clangcl.cfg.in
===================================================================
--- libcxx/test/configs/llvm-libc++-shared-no-vcruntime-clangcl.cfg.in
+++ libcxx/test/configs/llvm-libc++-shared-no-vcruntime-clangcl.cfg.in
@@ -6,10 +6,10 @@
config.substitutions.append(('%{flags}', '--driver-mode=g++'))
config.substitutions.append(('%{compile_flags}',
- '-nostdinc++ -I %{include} -I %{target-include} -I %{libcxx}/test/support -D_CRT_SECURE_NO_WARNINGS -D_CRT_NONSTDC_NO_WARNINGS -D_CRT_STDIO_ISO_WIDE_SPECIFIERS -DNOMINMAX -D_HAS_EXCEPTIONS=0' + config.dbg_include
+ '-fms-runtime-lib=' + config.fms_runtime_lib + ' -nostdinc++ -I %{include} -I %{target-include} -I %{libcxx}/test/support -D_CRT_SECURE_NO_WARNINGS -D_CRT_NONSTDC_NO_WARNINGS -D_CRT_STDIO_ISO_WIDE_SPECIFIERS -DNOMINMAX -D_HAS_EXCEPTIONS=0' + config.dbg_include
))
config.substitutions.append(('%{link_flags}',
- '-nostdlib -L %%{lib} -lc++ -l%s -l%s -loldnames' % (config.crt_lib, config.cxx_lib)
+ '-nostdlib -L %{lib} -lc++ -l' + config.cxx_lib
))
config.substitutions.append(('%{exec}',
'%{executor} --execdir %T --prepend_env PATH=%{lib} -- '
Index: libcxx/test/configs/llvm-libc++-shared-clangcl.cfg.in
===================================================================
--- libcxx/test/configs/llvm-libc++-shared-clangcl.cfg.in
+++ libcxx/test/configs/llvm-libc++-shared-clangcl.cfg.in
@@ -5,10 +5,10 @@
config.substitutions.append(('%{flags}', '--driver-mode=g++'))
config.substitutions.append(('%{compile_flags}',
- '-nostdinc++ -I %{include} -I %{target-include} -I %{libcxx}/test/support -D_CRT_SECURE_NO_WARNINGS -D_CRT_NONSTDC_NO_WARNINGS -D_CRT_STDIO_ISO_WIDE_SPECIFIERS -DNOMINMAX' + config.dbg_include
+ '-fms-runtime-lib=' + config.fms_runtime_lib + ' -nostdinc++ -I %{include} -I %{target-include} -I %{libcxx}/test/support -D_CRT_SECURE_NO_WARNINGS -D_CRT_NONSTDC_NO_WARNINGS -D_CRT_STDIO_ISO_WIDE_SPECIFIERS -DNOMINMAX' + config.dbg_include
))
config.substitutions.append(('%{link_flags}',
- '-nostdlib -L %%{lib} -lc++ -l%s -l%s -loldnames' % (config.crt_lib, config.cxx_lib)
+ '-nostdlib -L %{lib} -lc++ -l' + config.cxx_lib
))
config.substitutions.append(('%{exec}',
'%{executor} --execdir %T --prepend_env PATH=%{lib} -- '
Index: libcxx/test/CMakeLists.txt
===================================================================
--- libcxx/test/CMakeLists.txt
+++ libcxx/test/CMakeLists.txt
@@ -52,22 +52,22 @@
set(dbg_include "")
if (NOT CMAKE_MSVC_RUNTIME_LIBRARY OR CMAKE_MSVC_RUNTIME_LIBRARY MATCHES "DLL$")
- set(crt_lib "msvcrt")
+ set(fms_runtime_lib "dll")
set(cxx_lib "msvcprt")
else()
- set(crt_lib "libcmt")
+ set(fms_runtime_lib "static")
set(cxx_lib "libcpmt")
endif()
if ((NOT CMAKE_MSVC_RUNTIME_LIBRARY AND uppercase_CMAKE_BUILD_TYPE STREQUAL "DEBUG")
OR (CMAKE_MSVC_RUNTIME_LIBRARY MATCHES "Debug"))
- set(dbg_include " -D_DEBUG -include set_windows_crt_report_mode.h")
- set(crt_lib "${crt_lib}d")
+ set(dbg_include " -include set_windows_crt_report_mode.h")
+ set(fms_runtime_lib "${fms_runtime_lib}_dbg")
set(cxx_lib "${cxx_lib}d")
endif()
serialize_lit_param(dbg_include "\"${dbg_include}\"")
- serialize_lit_param(crt_lib "\"${crt_lib}\"")
+ serialize_lit_param(fms_runtime_lib "\"${fms_runtime_lib}\"")
serialize_lit_param(cxx_lib "\"${cxx_lib}\"")
endif()
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D155562.546599.patch
Type: text/x-patch
Size: 4564 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/libcxx-commits/attachments/20230802/f277c659/attachment.bin>
More information about the libcxx-commits
mailing list