-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathCMakeLists.txt
32 lines (24 loc) · 943 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
cmake_minimum_required(VERSION 3.13)
project(antiblock)
add_compile_options(-Wall -Wextra -Werror -Wpedantic)
add_link_options()
include_directories(include hashmap/include)
add_subdirectory(hashmap)
if(CMAKE_BUILD_TYPE MATCHES "Debug_ASan")
add_compile_options(-Og -g -fsanitize=address -fno-omit-frame-pointer)
add_link_options(-g -fsanitize=address)
endif()
if(CMAKE_BUILD_TYPE MATCHES "Debug_MSan")
add_compile_options(-Og -g -fsanitize=memory -fno-omit-frame-pointer)
add_link_options(-g -fsanitize=memory)
endif()
file(GLOB SRC "src/*.c")
add_executable(${PROJECT_NAME} ${SRC})
target_link_libraries(${PROJECT_NAME} hashmap curl)
install(TARGETS ${PROJECT_NAME} DESTINATION /usr/bin)
find_program(CLANGFORMAT clang-format)
if(CLANGFORMAT)
add_custom_command(TARGET ${PROJECT_NAME} PRE_BUILD
COMMAND clang-format -i ${CMAKE_CURRENT_SOURCE_DIR}/include/* ${CMAKE_CURRENT_SOURCE_DIR}/src/*
)
endif()