-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathCMakeLists.txt
executable file
·73 lines (62 loc) · 1.82 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
cmake_minimum_required(VERSION 3.0.0)
project(exquisite)
# For conan
list(APPEND CMAKE_MODULE_PATH ${CMAKE_BINARY_DIR})
list(APPEND CMAKE_PREFIX_PATH ${CMAKE_BINARY_DIR})
set(CMAKE_CXX_STANDARD 17)
set(CMAKE_EXPORT_COMPILE_COMMANDS on)
include(cmake/wall.cmake)
if(EXQUISITE_ENABLE_ASAN)
include(cmake/asan.cmake)
endif()
if(CMAKE_SYSTEM_NAME STREQUAL "Linux")
set(PLATFORM "linux")
elseif(CMAKE_SYSTEM_NAME STREQUAL "Darwin")
set(PLATFORM "mac")
else()
message(FATAL_ERROR "Building is not supported on this platform")
endif()
set(SRC
src/buffer.cpp
src/clipboard.cpp
src/colorscheme.cpp
src/commands.cpp
src/commands/find.cpp
src/config.cpp
src/control.cpp
src/editor.cpp
src/eventhandler.cpp
src/eventhandler_${PLATFORM}.cpp
src/fd.cpp
src/fuzzy.cpp
src/highlighting.cpp
src/key.cpp
src/languages.cpp
src/languages/cpp.cpp
src/main.cpp
src/palette.cpp
src/process.cpp
src/terminal.cpp
src/textbuffer.cpp
src/tree-sitter.cpp
src/utf8.cpp
src/util.cpp
)
# list(TRANSFORM SRC PREPEND src/) CMake on Ubuntu 18.04 can't do this
find_package(fmt)
find_package(sol2)
find_package(lua)
add_subdirectory(deps/treesitter)
add_executable(exquisite ${SRC})
target_compile_options(exquisite PRIVATE "-fdiagnostics-color=always")
target_include_directories(exquisite PRIVATE src)
target_link_libraries(exquisite stdc++fs) # Ubuntu 18.04 needs this
target_link_libraries(exquisite treesitter)
target_link_libraries(exquisite fmt::fmt)
target_link_libraries(exquisite lua::lua)
target_compile_definitions(exquisite PRIVATE -DSOL_ALL_SAFETIES_ON=1)
target_link_libraries(exquisite sol2::sol2)
target_include_directories(exquisite PRIVATE deps/clipp)
# https://github.com/phusion/holy-build-box/blob/master/ESSENTIAL-SYSTEM-LIBRARIES.md
target_link_libraries(exquisite -static-libstdc++)
set_wall(exquisite)