-
Notifications
You must be signed in to change notification settings - Fork 0
/
CMakeLists.txt
36 lines (24 loc) · 1022 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
33
34
35
cmake_minimum_required(VERSION 3.10)
set(CMAKE_EXPORT_COMPILE_COMMANDS ON)
project(Hadron)
# Use Clang as the compiler
set(CMAKE_C_COMPILER clang)
set(CMAKE_CXX_COMPILER clang++)
# Set C and C++ standards
set(CMAKE_C_STANDARD 17)
set(CMAKE_CXX_STANDARD 17)
# Enable static linking and custom flags for Windows release builds
if (CMAKE_SYSTEM_NAME STREQUAL "Windows")
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -static -static-libgcc -static-libstdc++ -O3 -Wall -Wextra -Wpedantic -Wno-format-security")
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -static -O3 -Wall -Wextra -Wpedantic -Wno-format-security")
endif ()
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -O3 -Wall -Wextra -Wpedantic -Wno-format-security")
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -O3 -Wall -Wextra -Wpedantic -Wno-format-security")
# Include directories
include_directories(include)
# Collect source files
file(GLOB_RECURSE SOURCES "src/*.cpp")
# Add the executable
add_executable(hadron ${SOURCES})
# Link libraries
target_link_libraries(hadron m)