-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathCMakeLists.txt
More file actions
46 lines (37 loc) · 890 Bytes
/
CMakeLists.txt
File metadata and controls
46 lines (37 loc) · 890 Bytes
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
cmake_minimum_required(VERSION 3.16)
project(hex-dump
VERSION 0.1
LANGUAGES CXX
)
# ---- Compiler settings ----
set(CMAKE_CXX_STANDARD 17)
set(CMAKE_CXX_STANDARD_REQUIRED ON)
set(CMAKE_CXX_EXTENSIONS OFF)
# Export compile_commands.json
set(CMAKE_EXPORT_COMPILE_COMMANDS ON)
# ---- Warnings (don’t be a coward) ----
if (CMAKE_CXX_COMPILER_ID MATCHES "GNU|Clang")
add_compile_options(
-Wall
-Wextra
-Wpedantic
)
endif()
# ---- Sources ----
set(SOURCES
src/main.cpp
src/cli.cpp
src/aho_corasick.cpp
src/mapped_file.cpp
src/validator.cpp
)
# ---- Target ----
add_executable(hex-dump ${SOURCES})
target_include_directories(hex-dump
PRIVATE
${PROJECT_SOURCE_DIR}/include
)
# ---- Optimization (optional, sane default) ----
if (NOT CMAKE_BUILD_TYPE)
set(CMAKE_BUILD_TYPE Release CACHE STRING "" FORCE)
endif()