-
Notifications
You must be signed in to change notification settings - Fork 5
/
CMakeLists.txt
59 lines (47 loc) · 948 Bytes
/
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
cmake_minimum_required(VERSION 3.25)
find_package(cmake-bare REQUIRED PATHS node_modules/cmake-bare)
find_package(cmake-fetch REQUIRED PATHS node_modules/cmake-fetch)
find_package(cmake-napi REQUIRED PATHS node_modules/cmake-napi)
project(udx_native C)
bare_target(target)
fetch_package("github:holepunchto/libudx#906ab07")
add_bare_module(udx_native_bare)
target_sources(
${udx_native_bare}
PRIVATE
binding.c
)
target_link_libraries(
${udx_native_bare}
PRIVATE
$<TARGET_OBJECTS:udx>
PUBLIC
udx
)
if(target MATCHES "win32")
target_link_libraries(
${udx_native_bare}
PUBLIC
ws2_32
)
endif()
add_napi_module(udx_native_node)
target_sources(
${udx_native_node}
PRIVATE
binding.c
)
target_link_libraries(
${udx_native_node}
PRIVATE
$<TARGET_OBJECTS:udx>
PUBLIC
udx
)
if(target MATCHES "win32")
target_link_libraries(
${udx_native_node}
PUBLIC
ws2_32
)
endif()