diff --git a/CMakeLists.txt b/CMakeLists.txt index e2f8c5c..3f72db2 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -9,9 +9,17 @@ PROJECT(${NAME}) ENABLE_TESTING() # Update if necessary -SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++17") -SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -O3") -SET(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -O3") +IF(CMAKE_CXX_COMPILER_ID MATCHES "Clang") + IF("${CMAKE_CXX_SIMULATE_ID}" STREQUAL "MSVC") + SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /std:c++17") + SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /O2") + SET(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} /O2") + else() + SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++17") + SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -O3") + SET(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -O3") + endif() +endif() # BUILD AND INCLUDE GOOGLETEST ADD_SUBDIRECTORY(libs/googletest/)