forked from ut-issl/s2e-core
-
Notifications
You must be signed in to change notification settings - Fork 0
/
common.cmake
34 lines (29 loc) · 1.21 KB
/
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
28
29
30
31
32
33
34
# 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 "/MP") # multi process build
target_compile_options(${PROJECT_NAME} PUBLIC "/W4")
if(NOT USE_HILS) # /MT option conflicts /clr option in the HILS config.
target_compile_options(${PROJECT_NAME} PUBLIC "/MT")
endif()
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")
# link option
target_link_options(${PROJECT_NAME} PUBLIC "-rdynamic")
if(NOT BUILD_64BIT)
# 32bit
target_compile_options(${PROJECT_NAME} PUBLIC "-m32")
target_link_options(${PROJECT_NAME} PUBLIC "-m32")
endif()
# debug
target_compile_options(${PROJECT_NAME} PUBLIC "-g")
endif()