-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathCMakeLists.txt
More file actions
71 lines (54 loc) · 1.45 KB
/
Copy pathCMakeLists.txt
File metadata and controls
71 lines (54 loc) · 1.45 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
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
cmake_minimum_required(VERSION 3.10)
project(Bitsel
VERSION 0.1.0
LANGUAGES CXX
)
# compile_commands.json
set(CMAKE_EXPORT_COMPILE_COMMANDS ON CACHE INTERNAL "")
set(CMAKE_CXX_STANDARD 17)
set(CMAKE_CXX_STANDARD_REQUIRED ON)
set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} "${PROJECT_SOURCE_DIR}/cmake/")
option(DEBUG_SYMBOL "add debug information" ON)
message(STATUS "DEBUG_SYMBOL: ${DEBUG_SYMBOL}")
if(DEBUG_SYMBOL)
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -g")
endif()
set(BITSEL_INCLUDE_DIR ${CMAKE_CURRENT_SOURCE_DIR}/include)
include_directories(${BITSEL_INCLUDE_DIR})
set(BITSEL_HEADERS include/bitsel.hpp)
set(BITSEL_SOURCES src/bitsel.cc)
add_library(bitsel SHARED ${BITSEL_SOURCES})
set(BITSEL_TEST_SOURCES test/bitsel_test.cc)
file(GLOB BITSEL_EXAMPLE_SOURCES example/*.cc)
target_compile_options(
bitsel PRIVATE
-Werror
-Wall
-Wextra
-Wno-noexcept-type # GCC
)
####################
# clang-tidy
####################
option(USE_CLANG_TIDY "use clang-tidy" ON)
include(cmake/clang_tidy.cmake)
setup_clang_tidy()
if(CLANG_TIDY_EXE AND USE_CLANG_TIDY)
set_target_properties(
bitsel PROPERTIES
CXX_CLANG_TIDY "${DO_CLANG_TIDY}"
)
endif()
####################
# clang-format
####################
include(cmake/clang_format.cmake)
add_clang_format_target()
####################
# test
####################
add_subdirectory(test)
####################
# example
####################
add_subdirectory(example)