-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathCMakeLists.txt
66 lines (54 loc) · 2.19 KB
/
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
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
cmake_minimum_required(VERSION 3.16.3)
set(PROGRAM haVoc)
project(haVoc
VERSION 1.0.0
DESCRIPTION "Hobby chess project"
LANGUAGES CXX
)
set(CMAKE_CXX_STANDARD 20)
set(CMAKE_CXX_STANDARD_REQUIRED ON)
###################################################################
# Options
###################################################################
###################################################################
# Source Files
###################################################################
set(SRC_FILES
bitboards.cpp
evaluate.cpp
hashtable.cpp
haVoc.cpp
magics.cpp
material.cpp
order.cpp
pawns.cpp
pgn.cpp
position.cpp
threads.cpp
uci.cpp
zobrist.cpp
)
###################################################################
# Build Configuration
###################################################################
if (NOT CMAKE_BUILD_TYPE)
message(STATUS "Build configuration not set, setting configuration to Release.")
set(CMAKE_BUILD_TYPE "Release" CACHE STRING "Build configuration type: Debug Release.")
endif()
###################################################################
# Compilation Options
###################################################################
if(WIN32)
if (${CMAKE_BUILD_TYPE} STREQUAL "Release")
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /bigobj /W3 /GR /EHsc /D_64BIT /D_CONSOLE /D_UNICODE /D_WIN32 /D_WIN64 /D_MSC_VER=1939 /std:c++20 /GS /GL /W3 /Gy /Zi /Gm- /O2 /Ob2 /Zc:inline /fp:precise /GT /WX- /Ot /FC /Oi /MD")
elseif (${CMAKE_BUILD_TYPE} STREQUAL "Debug")
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /bigobj /JMC /EHsc /GS /W3 /ZI /Gm- /Od /Zc:inline /fp:precise /WX- /RTC1 /Gd /MDd /FC /D_DEBUG /D_64BIT /D_CONSOLE /D_UNICODE /D_WIN32 /D_WIN64 /D_MSC_VER=1939 /std:c++20")
endif()
else()
if ("${CMAKE_BUILD_TYPE}" STREQUAL "Release")
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -pedantic -fomit-frame-pointer -fstrict-aliasing -ffast-math -Wa -mbig-obj -O3 -std=c++20 -D_64BIT -D_CONSOLE -D_UNICODE -mavx")
elseif ("${CMAKE_BUILD_TYPE}" STREQUAL "Debug")
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wa -Wall -g -ggdb -O0 -std=c++20 -D_DEBUG -D_64BIT -D_CONSOLE -D_UNICODE")
endif()
endif()
add_executable(${PROGRAM} ${SRC_FILES})