forked from RobotWebTools/rclnodejs
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbinding.gyp
118 lines (118 loc) · 2.88 KB
/
binding.gyp
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
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
{
'target_defaults': {
'default_configuration': 'Release',
'configurations': {
'Debug': {
'defines': ['SPDLOG_DEBUG_ON'],
},
}
},
'targets': [
{
'target_name': 'rclnodejs',
'variables': {
'ROS2_INSTALL_PATH': '<!(echo $AMENT_PREFIX_PATH)',
},
'sources': [
'./src/addon.cpp',
'./src/executor.cpp',
'./src/handle_manager.cpp',
'./src/rcl_bindings.cpp',
'./src/rcl_handle.cpp',
'./src/rcl_utilities.cpp',
'./src/shadow_node.cpp',
],
'include_dirs': [
'.',
'src/third_party/spdlog/include/',
"<!(node -e \"require('nan')\")",
],
'cflags!': [
'-fno-exceptions'
],
'cflags': [
'-fstack-protector-strong',
'-fPIE -fPIC',
'-O2 -D_FORTIFY_SOURCE=2',
'-Wformat -Wformat-security'
],
'cflags_cc!': [
'-fno-exceptions'
],
'libraries': [
'-lrcl',
'-lrcutils',
'-lrmw',
'-lrosidl_generator_c',
],
'conditions': [
[
'OS=="linux"', {
'defines': [
'OS_LINUX'
],
'include_dirs': [
"<(ROS2_INSTALL_PATH)/include/",
],
'cflags_cc': [
'-std=c++14'
],
'libraries': [
'-L<(ROS2_INSTALL_PATH)/lib'
],
}
],
[
'OS=="win"',
{
'defines': [
'OS_WINDOWS'
],
'variables': {
"ROS2_INSTALL_PATH_WINDOWS": "<!(echo %AMENT_PREFIX_PATH%)",
},
'cflags_cc': [
'-std=c++14'
],
'include_dirs': [
'./src/third_party/dlfcn-win32/',
'<(ROS2_INSTALL_PATH_WINDOWS)/include/',
],
'sources': [
'./src/third_party/dlfcn-win32/dlfcn.c',
],
'msvs_settings': {
'VCCLCompilerTool': {
'ExceptionHandling': '2', # /EHsc
},
'VCLinkerTool': {
'AdditionalDependencies': ['psapi.lib'],
'AdditionalLibraryDirectories': ['<(ROS2_INSTALL_PATH_WINDOWS)/lib/'],
}
}
}
],
[
'OS=="mac"',
{
'defines': [
'OS_MACOS'
],
'include_dirs': [
"<(ROS2_INSTALL_PATH)/include/",
],
'libraries': [
'-L<(ROS2_INSTALL_PATH)/lib'
],
'xcode_settings': {
'GCC_ENABLE_CPP_EXCEPTIONS': 'YES',
'CLANG_CXX_LIBRARY': 'libc++',
'MACOS_DEPLOYMENT_TARGET': '10.12',
'CLANG_CXX_LANGUAGE_STANDARD': 'c++14'
}
}
]
]
}
]
}