-
Notifications
You must be signed in to change notification settings - Fork 27
Expand file tree
/
Copy pathCMakeLists.txt
More file actions
49 lines (41 loc) · 2.36 KB
/
Copy pathCMakeLists.txt
File metadata and controls
49 lines (41 loc) · 2.36 KB
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
cmake_minimum_required(VERSION 3.15)
set(CMAKE_EXPORT_COMPILE_COMMANDS ON)
set(CMAKE_CXX_STANDARD 11)
#set(CMAKE_CXX_FLAGS "-O2 -g3 -fsanitize=address -I/opt/homebrew/include")
set(CMAKE_CXX_FLAGS "-O3 -g3 -pthread -DHANDYPSP -Wno-deprecated-declarations")
#set(CMAKE_CXX_FLAGS "-O3 -g3 -pthread -DHANDYPSP -Wall -Wextra -Wno-deprecated-declarations -Wno-unused-variable -Wno-unused-parameter -Wno-unused-private-field")
#set(CMAKE_CXX_FLAGS "-O2 -g3 -pthread -DHANDYPSP -fsanitize=address,undefined -fno-omit-frame-pointer -Wno-deprecated-declarations")
find_package(SDL2 REQUIRED)
message(STATUS "sdl includes: ${SDL2_INCLUDE_DIRS}")
message(STATUS "sdl libs: ${SDL2_LIBRARIES}")
include_directories(${SDL2_INCLUDE_DIRS})
include_directories(${CMAKE_CURRENT_SOURCE_DIR})
if(ENABLE_SERIAL_PORT)
message(STATUS "serial port support enabled!")
add_definitions(-DENABLE_SERIAL_PORT)
find_package(PkgConfig REQUIRED)
pkg_check_modules(LIBSERIALPORT REQUIRED libserialport)
message(STATUS "libserialport cflags: ${LIBSERIALPORT_CFLAGS}")
message(STATUS "libserialport includess: ${LIBSERIALPORT_INCLUDE_DIRS}")
message(STATUS "libserialport libs: ${LIBSERIALPORT_LIBRARIES}")
message(STATUS "libserialport libdir: ${LIBSERIALPORT_LIBDIR}")
include_directories(${LIBSERIALPORT_INCLUDE_DIRS})
link_directories(${LIBSERIALPORT_LIBDIR})
endif()
if(ENABLE_UDP_SERVER)
message(STATUS "udp server support enabled!")
add_definitions(-DENABLE_UDP_SERVER)
endif()
#target_link_libraries(a.out PRIVATE "-Wl,-stack_size -Wl,3f00000")
#target_link_directories(a.out PUBLIC "/opt/homebrew/lib")
add_executable(a.out main.cpp nc2000.cpp misc/disassembler.cpp cpu_loop.cpp comm.cpp mem.cpp io.cpp rom.cpp nor.cpp nand.cpp ram.cpp dsp/dsp.cpp sound.cpp cmd.cpp misc/udp_server.cpp ansi/w65c02cpu.cpp ansi/w65c02op.cpp NekoDriverIO.cpp key_new.cpp compare/c6502.cpp compare/pc1000bus.cpp cpu_loop_new.cpp settings.cpp key.cpp display.cpp io_new.cpp lcdstripe/json.cpp lcdstripe/lcdpainter.cpp cpu.cpp console.cpp misc/disassembler_new.cpp iv_uart.cpp misc/bin_dec.cpp)
target_link_libraries(a.out ${SDL2_LIBRARIES})
if(ENABLE_UDP_SERVER)
if(WIN32)
target_link_libraries(a.out wsock32 ws2_32)
endif()
endif()
if(ENABLE_SERIAL_PORT)
target_compile_options(a.out PRIVATE ${LIBSERIALPORT_CFLAGS})
target_link_libraries(a.out ${LIBSERIALPORT_LIBRARIES})
endif()