-
Notifications
You must be signed in to change notification settings - Fork 148
/
Copy pathCMakeLists.txt
49 lines (44 loc) · 1.48 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
cmake_minimum_required(VERSION 3.10)
project(maiden-repl VERSION 1.0.0)
set (CMAKE_CC_FLAGS "${CMAKE_CC_FLAGS} -Wall")
set (CMAKE_CC_FLAGS "${CMAKE_CC_FLAGS_DEBUG} -O0")
set (CMAKE_CC_FLAGS "${CMAKE_CC_FLAGS_RELEASE} -O2")
set (SRC src/main.c
src/io.c
src/page.c
src/pages.c
src/ui.c)
add_executable(maiden-repl ${SRC})
if(UNIX)
if(APPLE)
find_library(readline libreadline.dylib
NO_DEFAULT_PATH
HINTS
/opt/homebrew/opt/readline/lib
REQUIRED)
find_library(nanomsg libnanomsg.dylib
NO_DEFAULT_PATH
HINTS
/opt/homebrew/opt/nanomsg/lib
REQUIRED)
target_link_libraries(maiden-repl
${readline}
ncurses
panel
${nanomsg})
include_directories(/usr/local/include /opt/homebrew/opt/nanomsg/include /opt/homebrew/opt/readline/include)
else()
set(CURSES_NEED_NCURSES TRUE)
set(CURSES_NEED_WIDE TRUE) # Required for unicode
find_package(Curses REQUIRED)
include_directories(${CURSES_INCLUDE_DIR})
target_link_libraries(maiden-repl ${CURSES_LIBRARIES})
target_link_libraries(maiden-repl pthread)
target_link_libraries(maiden-repl readline)
target_link_libraries(maiden-repl panel)
target_link_libraries(maiden-repl nanomsg)
endif()
else()
# nope
endif()
target_compile_options(maiden-repl PRIVATE -Wall -Wextra -Werror -pedantic)