-
Notifications
You must be signed in to change notification settings - Fork 0
/
CMakeLists.txt
34 lines (28 loc) · 1.04 KB
/
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.5)
project(Lucid)
set(CMAKE_C_FLAGS_DEBUG "-Wall -Wextra -g")
set(CMAKE_C_FLAGS_MINSIZEREL "-Wall -Wextra -O0")
set(CMAKE_C_FLAGS_RELWITHDEBINFO "-Wall -Wextra -g -O2")
set(CMAKE_C_FLAGS_RELEASE "-Wall -Wextra -O2")
if (ASAN)
add_compile_options(-fsanitize=address -g)
add_link_options(-fsanitize=address)
endif()
add_compile_options(-g -Iinclude -Wall -Wextra -std=c++2b)
set (EXCLUDE_DIR "/CMakeFiles/")
file (GLOB_RECURSE SRC_FILES "*.cpp" "*.cxx" "*.cc" "*.c")
foreach (TMP_PATH ${SRC_FILES})
string (FIND ${TMP_PATH} ${EXCLUDE_DIR} EXCLUDE_DIR_FOUND)
if (NOT ${EXCLUDE_DIR_FOUND} EQUAL -1)
list (REMOVE_ITEM SRC_FILES ${TMP_PATH})
endif ()
endforeach(TMP_PATH)
set (EXCLUDE_DIR "/external/")
foreach (TMP_PATH ${SRC_FILES})
string (FIND ${TMP_PATH} ${EXCLUDE_DIR} EXCLUDE_DIR_FOUND)
if (NOT ${EXCLUDE_DIR_FOUND} EQUAL -1)
list (REMOVE_ITEM SRC_FILES ${TMP_PATH})
endif ()
endforeach(TMP_PATH)
add_executable(lucid ${SRC_FILES})
target_link_libraries(lucid ${CAPSTONE_LIBRARIES})