-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathCMakeLists.txt
More file actions
56 lines (43 loc) · 1.38 KB
/
CMakeLists.txt
File metadata and controls
56 lines (43 loc) · 1.38 KB
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
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
cmake_minimum_required(VERSION 3.16)
project (CAces C)
set(CMAKE_C_STANDARD 11)
set(CMAKE_C_STANDARD_REQUIRED On)
if(NOT CMAKE_BUILD_TYPE)
set(CMAKE_BUILD_TYPE "Release")
endif()
if(CMAKE_BUILD_TYPE STREQUAL "Release")
add_definitions(-DNDEBUG)
set(CMAKE_INTERPROCEDURAL_OPTIMIZATION TRUE)
endif()
set(CMAKE_CXX_FLAGS_RELEASE "-O3")
set(CMAKE_EXPORT_COMPILE_COMMANDS On)
add_compile_options(-Wall -Wextra -pedantic -Werror)
set(SOURCE_FILES
${CMAKE_CURRENT_SOURCE_DIR}/src/Aces.c
${CMAKE_CURRENT_SOURCE_DIR}/src/Aces-internal.c
${CMAKE_CURRENT_SOURCE_DIR}/src/Channel.c
${CMAKE_CURRENT_SOURCE_DIR}/src/Matrix.c
${CMAKE_CURRENT_SOURCE_DIR}/src/Common.c
${CMAKE_CURRENT_SOURCE_DIR}/src/Polynomial.c
)
add_library(CAces STATIC ${SOURCE_FILES})
target_link_libraries(CAces PRIVATE m)
target_include_directories(CAces PUBLIC
${CMAKE_CURRENT_SOURCE_DIR}/lib
)
option(CACES_BENCHMARK "Enable benchmarking" OFF)
option(CACES_TEST "Enable tests" OFF)
option(CACES_EXAMPLE "Enable examples" OFF)
if (CACES_BENCHMARK)
add_subdirectory(benchmarks)
endif()
if (CACES_TEST)
add_subdirectory(tests)
endif()
if (CACES_EXAMPLE)
add_subdirectory(examples)
endif()
add_custom_target(
clang-tidy-check clang-tidy -p ${CMAKE_BINARY_DIR}/compile_commands.json -checks=cert* --warnings-as-errors=* -header-filter=.* ${SOURCE_FILES}
DEPENDS ${SOURCE_FILES}
)