File tree Expand file tree Collapse file tree 4 files changed +30
-51
lines changed Expand file tree Collapse file tree 4 files changed +30
-51
lines changed Original file line number Diff line number Diff line change @@ -46,6 +46,30 @@ if (NOT DEFINED LIBCXX_TEST_DEPS)
46
46
message (FATAL_ERROR "Expected LIBCXX_TEST_DEPS to be defined" )
47
47
endif ()
48
48
49
+ if (MSVC )
50
+ # Shared code for initializing some parameters used by all
51
+ # llvm-libc++-*-clangcl.cfg.in test configs.
52
+ set (dbg_include "" )
53
+
54
+ if (NOT CMAKE_MSVC_RUNTIME_LIBRARY OR CMAKE_MSVC_RUNTIME_LIBRARY MATCHES "DLL$" )
55
+ set (crt_lib "msvcrt" )
56
+ set (cxx_lib "msvcprt" )
57
+ else ()
58
+ set (crt_lib "libcmt" )
59
+ set (cxx_lib "libcpmt" )
60
+ endif ()
61
+
62
+ if (uppercase_CMAKE_BUILD_TYPE STREQUAL "DEBUG" )
63
+ set (dbg_include " -D_DEBUG -include set_windows_crt_report_mode.h" )
64
+ set (crt_lib "${crt_lib} d" )
65
+ set (cxx_lib "${cxx_lib} d" )
66
+ endif ()
67
+
68
+ serialize_lit_param (dbg_include "\" ${dbg_include} \" " )
69
+ serialize_lit_param (crt_lib "\" ${crt_lib} \" " )
70
+ serialize_lit_param (cxx_lib "\" ${cxx_lib} \" " )
71
+ endif ()
72
+
49
73
if (LIBCXX_INCLUDE_TESTS )
50
74
include (AddLLVM ) # for configure_lit_site_cfg and add_lit_testsuite
51
75
Original file line number Diff line number Diff line change 3
3
4
4
lit_config.load_config(config, '@CMAKE_CURRENT_BINARY_DIR@/cmake-bridge.cfg')
5
5
6
- dbg_include = ''
7
- runtime_library = '@CMAKE_MSVC_RUNTIME_LIBRARY@'
8
-
9
- if runtime_library == '' or runtime_library.endswith('DLL'):
10
- crt_lib = 'msvcrt'
11
- cxx_lib = 'msvcprt'
12
- else:
13
- crt_lib = 'libcmt'
14
- cxx_lib = 'libcpmt'
15
-
16
- if '@uppercase_CMAKE_BUILD_TYPE@' == 'DEBUG':
17
- dbg_include = ' -D_DEBUG -include set_windows_crt_report_mode.h'
18
- crt_lib += 'd'
19
- cxx_lib += 'd'
20
-
21
6
config.substitutions.append(('%{flags}', '--driver-mode=g++'))
22
7
config.substitutions.append(('%{compile_flags}',
23
- '-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' + dbg_include
8
+ '-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
24
9
))
25
10
config.substitutions.append(('%{link_flags}',
26
- '-nostdlib -L %%{lib} -lc++ -l%s -l%s -loldnames' % (crt_lib, cxx_lib)
11
+ '-nostdlib -L %%{lib} -lc++ -l%s -l%s -loldnames' % (config. crt_lib, config. cxx_lib)
27
12
))
28
13
config.substitutions.append(('%{exec}',
29
14
'%{executor} --execdir %T --prepend_env PATH=%{lib} -- '
Original file line number Diff line number Diff line change 4
4
5
5
lit_config.load_config(config, '@CMAKE_CURRENT_BINARY_DIR@/cmake-bridge.cfg')
6
6
7
- dbg_include = ''
8
- runtime_library = '@CMAKE_MSVC_RUNTIME_LIBRARY@'
9
-
10
- if runtime_library == '' or runtime_library.endswith('DLL'):
11
- crt_lib = 'msvcrt'
12
- cxx_lib = 'msvcprt'
13
- else:
14
- crt_lib = 'libcmt'
15
- cxx_lib = 'libcpmt'
16
-
17
- if '@uppercase_CMAKE_BUILD_TYPE@' == 'DEBUG':
18
- dbg_include = ' -D_DEBUG -include set_windows_crt_report_mode.h'
19
- crt_lib += 'd'
20
- cxx_lib += 'd'
21
-
22
7
config.substitutions.append(('%{flags}', '--driver-mode=g++'))
23
8
config.substitutions.append(('%{compile_flags}',
24
- '-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' + dbg_include
9
+ '-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
25
10
))
26
11
config.substitutions.append(('%{link_flags}',
27
- '-nostdlib -L %%{lib} -lc++ -l%s -l%s -loldnames' % (crt_lib, cxx_lib)
12
+ '-nostdlib -L %%{lib} -lc++ -l%s -l%s -loldnames' % (config. crt_lib, config. cxx_lib)
28
13
))
29
14
config.substitutions.append(('%{exec}',
30
15
'%{executor} --execdir %T --prepend_env PATH=%{lib} -- '
Original file line number Diff line number Diff line change 3
3
4
4
lit_config.load_config(config, '@CMAKE_CURRENT_BINARY_DIR@/cmake-bridge.cfg')
5
5
6
- dbg_include = ''
7
- runtime_library = '@CMAKE_MSVC_RUNTIME_LIBRARY@'
8
-
9
- if runtime_library == '' or runtime_library.endswith('DLL'):
10
- crt_lib = 'msvcrt'
11
- cxx_lib = 'msvcprt'
12
- else:
13
- crt_lib = 'libcmt'
14
- cxx_lib = 'libcpmt'
15
-
16
- if '@uppercase_CMAKE_BUILD_TYPE@' == 'DEBUG':
17
- dbg_include = ' -D_DEBUG -include set_windows_crt_report_mode.h'
18
- crt_lib += 'd'
19
- cxx_lib += 'd'
20
-
21
6
config.substitutions.append(('%{flags}', '--driver-mode=g++'))
22
7
config.substitutions.append(('%{compile_flags}',
23
- '-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' + dbg_include
8
+ '-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
24
9
))
25
10
config.substitutions.append(('%{link_flags}',
26
- '-nostdlib -L %%{lib} -llibc++ -l%s -l%s -loldnames' % (crt_lib, cxx_lib)
11
+ '-nostdlib -L %%{lib} -llibc++ -l%s -l%s -loldnames' % (config. crt_lib, config. cxx_lib)
27
12
))
28
13
config.substitutions.append(('%{exec}',
29
14
'%{executor} --execdir %T -- '
You can’t perform that action at this time.
0 commit comments