diff options
author | Loo Rong Jie <loorongjie@gmail.com> | 2017-11-28 13:36:16 +0800 |
---|---|---|
committer | Loo Rong Jie <loorongjie@gmail.com> | 2017-11-28 13:36:16 +0800 |
commit | 79ae60ed9737f6c0ec652eab5492b1359aaea9cf (patch) | |
tree | 95f1895b0824990b7204d37618739c62655fba18 /CMakeLists.txt | |
parent | 79610733f46c888b56d05d7ca981350655c55a5d (diff) |
MSVC fixes
Diffstat (limited to 'CMakeLists.txt')
-rw-r--r-- | CMakeLists.txt | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt index e87f4a84..a740088a 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -26,7 +26,12 @@ include(AbseilHelpers) # config options -set(ABSL_STD_CXX_FLAG "-std=c++11" CACHE STRING "c++ std flag (default: c++11)") +if (MSVC) + add_definitions(/DNOMINMAX /DWIN32_LEAN_AND_MEAN=1 /D_CRT_SECURE_NO_WARNINGS) + add_compile_options(/W3 /WX /wd4005 /wd4068 /wd4244 /wd4267 /wd4800) +else() + set(ABSL_STD_CXX_FLAG "-std=c++11" CACHE STRING "c++ std flag (default: c++11)") +endif() @@ -66,9 +71,6 @@ check_target(gmock) # -fexceptions set(ABSL_EXCEPTIONS_FLAG "${CMAKE_CXX_EXCEPTIONS}") -# fix stuff -set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FIX_MSVC} ${CMAKE_CXX_FLAGS}") - list(APPEND ABSL_TEST_COMMON_LIBRARIES gtest_main gtest |