-
Notifications
You must be signed in to change notification settings - Fork 1
/
CMakeLists.txt
56 lines (50 loc) · 1.26 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
cmake_minimum_required(VERSION 3.5)
project(rogue-clone)
set(SOURCES
rogue/hit.c
rogue/init.c
rogue/inventory.c
rogue/level.c
rogue/machdep.c
rogue/main.c
rogue/message.c
rogue/monster.c
rogue/move.c
rogue/object.c
rogue/pack.c
rogue/play.c
rogue/random.c
rogue/ring.c
rogue/room.c
rogue/save.c
rogue/score.c
rogue/spec_hit.c
rogue/throw.c
rogue/trap.c
rogue/use.c
rogue/zap.c
)
add_executable(rogue-clone ${SOURCES})
if (CMAKE_GENERATOR MATCHES "Visual Studio")
message(FATAL_ERROR "Sorry, Visual Studio cannot be used, MinGW is required on Windows.")
elseif (WIN32)
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Wall -static")
set(CMAKE_CPP_FLAGS "${CMAKE_C_FLAGS} -Wall -static")
set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -static")
target_compile_definitions(rogue-clone PRIVATE
-DPDC_WIDE=1
-DPDC_FORCE_UTF8=1
)
target_link_libraries(rogue-clone
pdcurses_wincon
winmm
)
else()
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Wall -static")
set(CMAKE_CPP_FLAGS "${CMAKE_C_FLAGS} -Wall -static")
set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -static")
target_link_libraries(rogue-clone
ncurses
tinfo
)
endif()