-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathCMakeLists.txt
59 lines (40 loc) · 1.49 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
#Require a minimum version
cmake_minimum_required(VERSION 3.10)
set(CMAKE_CXX_STANDARD 20)
project(uva-lang)
set(CMAKE_POSITION_INDEPENDENT_CODE ON)
# Get the parent directory
get_filename_component(UVALANG_PARENT_DIRECTORY ${CMAKE_CURRENT_LIST_DIR} DIRECTORY)
include("${UVALANG_PARENT_DIRECTORY}/uva/CMakeLists.txt")
uva_library(core)
uva_library(file)
uva_library(console)
include_directories(${CMAKE_CURRENT_LIST_DIR})
include_directories(include/fmt/include)
add_library(uva-parser
${CMAKE_CURRENT_LIST_DIR}/parser/parser.cpp
)
target_link_libraries(uva-parser uva-lexer)
add_library(uva-extension
${CMAKE_CURRENT_LIST_DIR}/extension/src/extension.cpp
)
target_link_libraries(uva-extension uva-file)
include("${CMAKE_CURRENT_LIST_DIR}/interpreter/CMakeLists.txt")
include("${CMAKE_CURRENT_LIST_DIR}/lexer/CMakeLists.txt")
include("${CMAKE_CURRENT_LIST_DIR}/lang/CMakeLists.txt")
include("${CMAKE_CURRENT_LIST_DIR}/preprocessor/CMakeLists.txt")
add_executable(uva
${CMAKE_CURRENT_LIST_DIR}/uva/src/uva.cpp
)
if(UNIX)
target_link_libraries(uva-extension ${CMAKE_DL_LIBS})
endif()
target_link_libraries(uva uva-extension uva-preprocessor uva-interpreter uva-lang uva-core uva-console uva-file)
install(TARGETS uva DESTINATION bin)
set(EXTENSIONS_FOLDER "${UVALANG_PARENT_DIRECTORY}/uvalang-extensions")
file(GLOB EXTENSIONS "${EXTENSIONS_FOLDER}/*")
foreach(EXTENSION ${EXTENSIONS})
if(IS_DIRECTORY ${EXTENSION})
include("${EXTENSION}/CMakeLists.txt")
endif()
endforeach()