-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathcommon.cmake
More file actions
26 lines (19 loc) · 831 Bytes
/
common.cmake
File metadata and controls
26 lines (19 loc) · 831 Bytes
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
get_filename_component(name ${CMAKE_CURRENT_SOURCE_DIR} NAME)
project(${name})
include(${CMAKE_CURRENT_LIST_DIR}/build_tools/cmake/option.cmake)
file(GLOB_RECURSE addons_list "fib-addon/src/*.c*")
add_library(${name} SHARED ${src_list} ${addons_list})
include_directories(
"${PROJECT_SOURCE_DIR}/include"
"${PROJECT_SOURCE_DIR}/fib-addon/include"
"${PROJECT_SOURCE_DIR}/fib-addon/node-addon-api"
"${CMAKE_CURRENT_BINARY_DIR}")
if(MSVC)
target_link_libraries(${name} "${PROJECT_SOURCE_DIR}/fib-addon/lib/node_${BUILD_ARCH}.lib")
set(link_flags "${link_flags} /DELAYLOAD:node.exe")
else()
set(link_flags "${link_flags} -Wl,-undefined,dynamic_lookup")
endif()
setup_result_library(${name})
set_target_properties(${name} PROPERTIES PREFIX "")
set_target_properties(${name} PROPERTIES SUFFIX ".node")