Skip to content

Commit 10f04c7

Browse files
committed
Solve minor bug with v8 headers in FindNodeJS:
1 parent e5c8369 commit 10f04c7

File tree

1 file changed

+17
-22
lines changed

1 file changed

+17
-22
lines changed

cmake/FindNodeJS.cmake

Lines changed: 17 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -70,14 +70,10 @@ endif()
7070

7171
set(NODEJS_UV_HEADERS uv.h) # TODO: Add uv-(platform).h?
7272

73-
find_path(NODEJS_UV_INCLUDE_DIR ${NODEJS_UV_HEADERS}
74-
PATHS /usr/include/compat-libuv010
75-
NO_DEFAULT_PATH
76-
)
77-
7873
set(NODEJS_HEADERS
7974
node.h
8075
${NODEJS_V8_HEADERS}
76+
${NODEJS_UV_HEADERS}
8177
)
8278

8379
set(NODEJS_INCLUDE_SUFFIXES
@@ -91,18 +87,6 @@ set(NODEJS_INCLUDE_SUFFIXES
9187
include/nodejs/deps/uv/include
9288
)
9389

94-
if(NOT NODEJS_UV_INCLUDE_DIR)
95-
set(NODEJS_HEADERS
96-
${NODEJS_HEADERS}
97-
${NODEJS_UV_HEADERS}
98-
)
99-
100-
set(NODEJS_INCLUDE_SUFFIXES
101-
${NODEJS_INCLUDE_SUFFIXES}
102-
include/deps/uv/include
103-
)
104-
endif()
105-
10690
set(NODEJS_INCLUDE_PATHS
10791
/usr
10892
/usr/local
@@ -178,11 +162,20 @@ find_path(NODEJS_INCLUDE_DIR ${NODEJS_HEADERS}
178162
DOC "NodeJS JavaScript Runtime Headers"
179163
)
180164

181-
if(NOT NODEJS_INCLUDE_DIR AND NOT NODEJS_VERSION)
182-
# We do not have any way to know what version to install
183-
message(WARNING "NodeJS headers could not be found, neither a valid NodeJS version.")
184-
return()
185-
else()
165+
message(STATUS "1) --- ${NODEJS_INCLUDE_DIR}")
166+
167+
# # Check if the include directory contains all headers in the same folder
168+
# if(NODEJS_INCLUDE_DIR)
169+
170+
# endif()
171+
172+
if(NOT NODEJS_INCLUDE_DIR)
173+
if(NOT NODEJS_VERSION)
174+
# We do not have any way to know what version to install
175+
message(WARNING "NodeJS headers could not be found, neither a valid NodeJS version.")
176+
return()
177+
endif()
178+
186179
# TODO: Remove this workaround when NodeJS begins to distribute node as a shared library (maybe never?) with proper includes
187180

188181
# NodeJS download and output path (workaround for NodeJS headers)
@@ -210,6 +203,8 @@ else()
210203
PATH_SUFFIXES ${NODEJS_INCLUDE_SUFFIXES}
211204
DOC "NodeJS JavaScript Runtime Headers"
212205
)
206+
207+
message(STATUS "2) --- ${NODEJS_INCLUDE_DIR}")
213208
endif()
214209

215210
if(NODEJS_INCLUDE_DIR)

0 commit comments

Comments
 (0)