-
-
Notifications
You must be signed in to change notification settings - Fork 3
/
CMakeLists.txt
136 lines (117 loc) · 2.55 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
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
# (C) 2018-2024 by Folkert van Heusden
# Released under MIT license
project(PDP-11)
cmake_minimum_required(VERSION 3.9)
add_compile_options(-Wall -pedantic -Wextra)
#add_compile_options(-fsanitize=undefined)
#add_link_options(-fsanitize=undefined)
#add_compile_options(-fanalyzer)
set(CMAKE_CXX_STANDARD 17)
set(CMAKE_CXX_STANDARD_REQUIRED True)
include(FindPkgConfig)
if (NOT WIN32)
add_executable(
kek
breakpoint.cpp
breakpoint_and.cpp
breakpoint_memory.cpp
breakpoint_or.cpp
breakpoint_parser.cpp
breakpoint_register.cpp
bus.cpp
comm.cpp
comm_posix_tty.cpp
comm_tcp_socket_client.cpp
comm_tcp_socket_server.cpp
console.cpp
console_ncurses.cpp
console_posix.cpp
cpu.cpp
dc11.cpp
debugger.cpp
device.cpp
disk_backend.cpp
disk_backend_file.cpp
disk_backend_nbd.cpp
error.cpp
kw11-l.cpp
loaders.cpp
log.cpp
main.cpp
memory.cpp
mmu.cpp
rk05.cpp
rl02.cpp
rp06.cpp
terminal.cpp
tm-11.cpp
tty.cpp
utils.cpp
)
pkg_check_modules(NCURSES REQUIRED ncurses)
target_link_libraries(kek ${NCURSES_LIBRARIES})
target_include_directories(kek PUBLIC ${NCURSES_INCLUDE_DIRS})
target_compile_options(kek PUBLIC ${NCURSES_CFLAGS_OTHER})
pkg_check_modules(PANEL REQUIRED panel)
target_link_libraries(kek ${PANEL_LIBRARIES})
target_include_directories(kek PUBLIC ${PANEL_INCLUDE_DIRS})
target_compile_options(kek PUBLIC ${PANEL_CFLAGS_OTHER})
endif (NOT WIN32)
if (WIN32)
add_executable(
kek-win32
breakpoint.cpp
breakpoint_and.cpp
breakpoint_memory.cpp
breakpoint_or.cpp
breakpoint_parser.cpp
breakpoint_register.cpp
bus.cpp
comm.cpp
comm_posix_tty.cpp
comm_tcp_socket_client.cpp
comm_tcp_socket_server.cpp
console.cpp
console_posix.cpp
cpu.cpp
dc11.cpp
debugger.cpp
device.cpp
disk_backend.cpp
disk_backend_file.cpp
disk_backend_nbd.cpp
error.cpp
kw11-l.cpp
loaders.cpp
log.cpp
main.cpp
memory.cpp
mmu.cpp
rk05.cpp
rl02.cpp
rp06.cpp
tm-11.cpp
tty.cpp
utils.cpp
win32.cpp
)
endif (WIN32)
include(CheckIPOSupported)
check_ipo_supported(RESULT supported)
set(CMAKE_BUILD_TYPE RelWithDebInfo)
set(CMAKE_INTERPROCEDURAL_OPTIMIZATION_RELEASE TRUE)
#set(CMAKE_BUILD_TYPE Debug)
set(CMAKE_THREAD_PREFER_PTHREAD TRUE)
set(THREADS_PREFER_PTHREAD_FLAG TRUE)
find_package(Threads)
if (NOT WIN32)
target_link_libraries(kek Threads::Threads)
else ()
target_link_libraries(kek-win32 Threads::Threads)
target_link_libraries(kek-win32 ws2_32)
endif ()
add_subdirectory(arduinojson)
target_link_libraries(kek ArduinoJson)
if (WIN32)
target_link_libraries(kek-win32 ArduinoJson)
endif ()