generated from ut-issl/repository-template
-
Notifications
You must be signed in to change notification settings - Fork 1
/
common.cmake
27 lines (23 loc) · 1019 Bytes
/
common.cmake
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
# C++
set_target_properties(${PROJECT_NAME} PROPERTIES LANGUAGE CXX)
set_target_properties(${PROJECT_NAME} PROPERTIES CXX_STANDARD 17)
set_target_properties(${PROJECT_NAME} PROPERTIES CXX_EXTENSIONS FALSE)
# common include
target_include_directories(${PROJECT_NAME} PUBLIC ${S2E_DIR}/src)
target_include_directories(${PROJECT_NAME} PRIVATE ${CMAKE_CURRENT_SOURCE_DIR})
# Compile option
if(MSVC)
target_compile_options(${PROJECT_NAME} PUBLIC "/W4")
target_compile_options(${PROJECT_NAME} PUBLIC "/MT")
target_compile_options(${PROJECT_NAME} PUBLIC "/source-charset:utf-8")
else()
target_compile_options(${PROJECT_NAME} PUBLIC "-Wall")
target_compile_options(${PROJECT_NAME} PUBLIC "-Wextra")
target_compile_options(${PROJECT_NAME} PUBLIC "-Wpedantic")
target_compile_options(${PROJECT_NAME} PUBLIC "-rdynamic")
# 32bit
target_compile_options(${PROJECT_NAME} PUBLIC "-m32")
target_link_options(${PROJECT_NAME} PUBLIC "-m32")
# debug
target_compile_options(${PROJECT_NAME} PUBLIC "-g")
endif()