-
-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathCMakeLists.txt
50 lines (43 loc) · 1.22 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
# ------------------------------------------------------------------------------
# CMakeLists.txt (Libraries)
# ------------------------------------------------------------------------------
set(CMAKE_POSITION_INDEPENDENT_CODE ON)
if(MSVC)
set(CMAKE_RUNTIME_OUTPUT_DIRECTORY_DEBUG ${LIBRARY_DIR})
set(CMAKE_RUNTIME_OUTPUT_DIRECTORY_RELEASE ${LIBRARY_DIR})
endif()
if(NOT MSVC)
set(CMAKE_LIBRARY_OUTPUT_DIRECTORY ${LIBRARY_DIR})
set(CMAKE_ARCHIVE_OUTPUT_DIRECTORY ${LIBRARY_DIR})
endif()
set(SOURCES
"array.c"
"builtin.c"
"callable.c"
"chunk.c"
"utils.c"
"compiler.c"
"dump.c"
"iterable.c"
"iterator.c"
"lexer.c"
"memory.c"
"module.c"
"range.c"
"record.c"
"string.c"
"struct.c"
"userdata.c"
"value.c"
"vm.c"
)
add_library(${STATIC_LIB_TARGET} STATIC ${SOURCES})
add_library(${SHARED_LIB_TARGET} SHARED ${SOURCES})
set_target_properties(${STATIC_LIB_TARGET} PROPERTIES OUTPUT_NAME ${PROJECT_NAME})
set_target_properties(${SHARED_LIB_TARGET} PROPERTIES OUTPUT_NAME ${PROJECT_NAME})
if(NOT MSVC)
target_link_libraries(${STATIC_LIB_TARGET} m)
target_link_libraries(${STATIC_LIB_TARGET} dl)
target_link_libraries(${SHARED_LIB_TARGET} m)
target_link_libraries(${SHARED_LIB_TARGET} dl)
endif()