-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathCMakeLists.txt
34 lines (23 loc) · 912 Bytes
/
CMakeLists.txt
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
cmake_minimum_required(VERSION 3.10)
project(ExtraeWin LANGUAGES CXX)
# Set C++ 17 standard with no extensions
set(CMAKE_CXX_STANDARD 17)
set(CMAKE_CXX_STANDARD_REQUIRED On)
# Variadic macros with no arguments are an extension, but available in
# gcc, clan and msvc
# set(CMAKE_CXX_EXTENSIONS Off)
# Compile main with TB (for policies) and WALL
if (CMAKE_CXX_COMPILER_ID MATCHES "MSVC") # warning level 4
add_compile_options(/W4)
else() # additional warnings
find_package(TBB REQUIRED) # policies requires TBB
add_compile_options(-Wall -Wextra -Wpedantic)
endif()
add_executable(main.x main.cpp)
target_compile_definitions(main.x PRIVATE PROFILER_ENABLED=2)
if (NOT CMAKE_CXX_COMPILER_ID MATCHES "MSVC") # warning level 4
target_link_libraries(main.x TBB::tbb)
endif()
add_executable(Parser.x Parser.cpp)
enable_testing()
add_test(NAME "main" COMMAND $<TARGET_FILE:main.x>)