-
Notifications
You must be signed in to change notification settings - Fork 0
/
CMakeLists.txt
56 lines (41 loc) · 1.68 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
cmake_minimum_required(VERSION 3.24)
project(shikafx LANGUAGES C CXX)
set(CMAKE_CXX_STANDARD 20)
set(CMAKE_CXX_STANDARD_REQUIRED ON)
set(CMAKE_SKIP_BUILD_RPATH OFF)
set(CMAKE_BUILD_WITH_INSTALL_RPATH OFF)
set(CMAKE_INSTALL_RPATH "")
set(CMAKE_INSTALL_RPATH_USE_LINK_PATH OFF)
set(CMAKE_WINDOWS_EXPORT_ALL_SYMBOLS ON)
if (CMAKE_CXX_COMPILER_ID STREQUAL "GNU")
add_compile_options(-mlong-double-128)
endif()
option(USE_DEBUG "Enable debug mode" OFF)
if (USE_DEBUG)
add_compile_definitions(DEBUG=1)
endif()
#if(WIN32)
# set(LIB_TYPE STATIC)
#else()
# set(LIB_TYPE SHARED)
#endif()
set(LIB_TYPE SHARED)
add_library(c-shikafx-ext ${LIB_TYPE} src/shikafx-ext/__ccode__/preload.c)
add_library(shikafx-ext ${LIB_TYPE} src/shikafx-ext/preload.cpp)
#target_include_directories(c-shikafx-ext PUBLIC ${PROJECT_SOURCE_DIR}/include/shikafx-ext/__ccode__)
#target_include_directories(shikafx-ext PUBLIC ${PROJECT_SOURCE_DIR}/include/shikafx-ext)
#set_target_properties(c-shikafx-ext PROPERTIES LINK_FLAGS "-Wl,-rpath,./")
#set_target_properties(shikafx-ext PROPERTIES LINK_FLAGS "-Wl,-rpath,./")
add_executable(shikafx main.cpp)
#set_target_properties(shikafx PROPERTIES LINK_FLAGS "-Wl,-rpath,./")
target_link_libraries(shikafx-ext PRIVATE c-shikafx-ext)
target_link_libraries(shikafx PRIVATE c-shikafx-ext)
target_link_libraries(shikafx PRIVATE shikafx-ext)
install(TARGETS shikafx DESTINATION bin)
install(TARGETS shikafx-ext DESTINATION lib)
install(TARGETS c-shikafx-ext DESTINATION lib)
export(TARGETS shikafx-ext FILE shikafx-ext.cmake)
export(TARGETS c-shikafx-ext FILE c-shikafx-ext.cmake)
if (CMAKE_CXX_COMPILER_ID STREQUAL "GNU")
add_compile_options(-fabi-version=4.4 -mlong-double-128)
endif()