-
Notifications
You must be signed in to change notification settings - Fork 0
/
CMakeLists.txt
67 lines (55 loc) · 1.84 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
65
66
cmake_minimum_required(VERSION 3.20)
project(prometheus VERSION 0.2)
set(CMAKE_CXX_STANDARD 20)
set(CMAKE_CXX_STANDARD_REQUIRED True)
SET(CMAKE_CXX_FLAGS "-pedantic")
SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wall")
SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wextra")
SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wconversion")
SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wshadow")
SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wcast-qual")
set(SOURCES
src/main.cpp
src/board/board.cpp
src/board/bitboard.cpp
src/hashing/poskey.cpp
src/hashing/poskey.h
src/move/move.cpp
src/move/move.h
src/move/movegen.cpp
src/move/movegen.h
src/util/assertions.cpp
src/util/util.cpp
src/search/search.cpp
src/hashing/pvtable.cpp
src/hashing/pvtable.h
src/search/evaluation.cpp
src/io/uci.cpp
src/io/uci.h
)
add_executable(prometheus ${SOURCES})
if (CMAKE_CXX_COMPILER_ID STREQUAL "GNU" OR CMAKE_CXX_COMPILER_ID STREQUAL "Clang" OR CMAKE_CXX_COMPILER_ID STREQUAL "AppleClang")
target_compile_options(prometheus PRIVATE
-pedantic
-Wall
-Wextra
-Wconversion
-Wshadow
-Wcast-qual
)
if (CMAKE_BUILD_TYPE STREQUAL "Release")
target_compile_options(prometheus PRIVATE -flto)
target_link_libraries(prometheus PRIVATE -flto)
endif()
message(STATUS "Using GCC or Clang compiler")
elseif (CMAKE_CXX_COMPILER_ID STREQUAL "MSVC")
target_compile_options(prometheus PRIVATE
/W4
)
message(STATUS "Using MSVC compiler")
else()
message(WARNING "Unsupported compiler ${CMAKE_CXX_COMPILER_ID}")
endif()
target_include_directories(prometheus PUBLIC)
find_package(Threads REQUIRED)
target_link_libraries(prometheus PRIVATE Threads::Threads)