2019-08-24 15:31:42 +00:00
|
|
|
include(CheckCXXCompilerFlag)
|
|
|
|
|
|
|
|
if((CMAKE_CXX_COMPILER_ID MATCHES "GNU") OR (CMAKE_CXX_COMPILER_ID MATCHES "Clang"))
|
|
|
|
set(OPTIONS -Wall -Wextra -pedantic-errors -Werror)
|
|
|
|
elseif(CMAKE_CXX_COMPILER_ID MATCHES "MSVC")
|
|
|
|
set(OPTIONS /W4 /WX)
|
|
|
|
if(HAS_PERMISSIVE_FLAG)
|
|
|
|
set(OPTIONS ${OPTIONS} /permissive-)
|
|
|
|
endif()
|
|
|
|
endif()
|
2019-07-31 16:09:26 +00:00
|
|
|
|
2019-08-24 15:31:42 +00:00
|
|
|
add_executable(example example.cpp)
|
|
|
|
set_target_properties(example PROPERTIES CXX_EXTENSIONS OFF)
|
|
|
|
target_compile_features(example PRIVATE cxx_std_17)
|
|
|
|
target_compile_options(example PRIVATE ${OPTIONS})
|
|
|
|
target_link_libraries(example PRIVATE ${CMAKE_PROJECT_NAME})
|