Skip to content

Commit

Permalink
Added support building on MSVC toolkit ClangCL
Browse files Browse the repository at this point in the history
  • Loading branch information
GermanAizek committed Jun 10, 2022
1 parent ca2783c commit 2f0ba17
Showing 1 changed file with 11 additions and 3 deletions.
14 changes: 11 additions & 3 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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/)
Expand Down

0 comments on commit 2f0ba17

Please sign in to comment.