Skip to content

Commit c49c188

Browse files
committed
Update CMakeLists
1 parent 57ff0a1 commit c49c188

File tree

3 files changed

+8
-15
lines changed

3 files changed

+8
-15
lines changed

.github/workflows/msvc_clang.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ jobs:
1919

2020
- win_ver: '2022'
2121
build_type: 'Debug'
22-
flags: '/std:c++latest -msse2 /DTEST_LIBCXX_NEW'
22+
flags: '/std:c++latest /WX -msse2 /DTEST_LIBCXX_NEW'
2323

2424
runs-on: windows-${{ matrix.win_ver }}
2525

test/CMakeLists.txt

+7-3
Original file line numberDiff line numberDiff line change
@@ -14,13 +14,17 @@ endif()
1414

1515
if(CMAKE_CXX_COMPILER_ID MATCHES "MSVC")
1616
string(REGEX REPLACE "/W[0-4]" "" CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS}")
17-
target_compile_options(momo_test PRIVATE /W4 /bigobj)
17+
target_compile_options(momo_test PRIVATE /W4 /D_SCL_SECURE_NO_WARNINGS /D_CRT_SECURE_NO_WARNINGS
18+
/wd4127 /wd4458 /bigobj)
19+
if(MSVC_VERSION EQUAL 1900)
20+
target_compile_options(momo_test PRIVATE /wd4503 /wd4702)
21+
endif()
1822
if(MSVC_VERSION GREATER_EQUAL 1910)
1923
target_compile_options(momo_test PRIVATE /Zc:__cplusplus)
2024
endif()
2125
elseif(CMAKE_CXX_COMPILER_ID STREQUAL "Clang" AND CMAKE_CXX_COMPILER_FRONTEND_VARIANT STREQUAL "MSVC")
22-
target_compile_options(momo_test PRIVATE /W4 -Wold-style-cast -Wsign-conversion
23-
-Wno-unused-local-typedefs)
26+
target_compile_options(momo_test PRIVATE /W4 /D_ITERATOR_DEBUG_LEVEL=0
27+
-Wold-style-cast -Wsign-conversion -Wno-unused-local-typedefs)
2428
elseif(CMAKE_CXX_COMPILER_ID MATCHES "GNU"
2529
OR CMAKE_CXX_COMPILER_ID MATCHES "Clang"
2630
OR CMAKE_CXX_COMPILER_ID MATCHES "Intel")

test/sources/pch.h

-11
Original file line numberDiff line numberDiff line change
@@ -14,17 +14,6 @@
1414

1515
#include "TestSettings.h"
1616

17-
#ifdef TEST_MSVC
18-
# define _SCL_SECURE_NO_WARNINGS
19-
# define _CRT_SECURE_NO_WARNINGS
20-
# pragma warning (disable: 4127) // conditional expression is constant
21-
# pragma warning (disable: 4458) // declaration of '...' hides class member
22-
# if _MSC_VER == 1900
23-
# pragma warning (disable: 4503) // decorated name length exceeded, name was truncated
24-
# pragma warning (disable: 4702) // unreachable code
25-
# endif
26-
#endif
27-
2817
#ifdef _WIN32
2918
# ifdef TEST_LIBCXX_NEW
3019
# define NOMINMAX

0 commit comments

Comments
 (0)