-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathCMakeLists.txt
More file actions
28 lines (22 loc) · 840 Bytes
/
CMakeLists.txt
File metadata and controls
28 lines (22 loc) · 840 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
cmake_minimum_required(VERSION 3.27)
project(hex_coder)
set(CMAKE_CXX_STANDARD 20)
set(CMAKE_CXX_STANDARD_REQUIRED ON)
set(CMAKE_CXX_EXTENSIONS OFF)
set(FLTO "-flto")
if (CMAKE_CXX_COMPILER MATCHES "clang")
set(FLTO "-flto=thin")
endif()
if (NOT CMAKE_GENERATOR MATCHES "Visual Studio")
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wall -fdiagnostics-color=always")
set(CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG} -O0 -fsanitize=address")
set(CMAKE_CXX_FLAGS_RELEASE "-Wall -Ofast ${FLTO} -march=native -DNDEBUG")
else()
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /Wall /std:c++20")
endif()
include_directories(include)
set(SOURCE_EXE src/main.cpp src/manager.cpp src/params.cpp)
add_executable(hex_coder ${SOURCE_EXE})
add_subdirectory(libs/hexcoder)
add_subdirectory(libs/hash)
target_link_libraries(hex_coder hexcoder hash)