Skip to content

Commit

Permalink
Improve search paths for node headers, particularly to deal with when
Browse files Browse the repository at this point in the history
node is a different version from its development headers.
  • Loading branch information
highperformancecoder committed Oct 17, 2023
1 parent 082a4bc commit 19bd894
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 11 deletions.
19 changes: 9 additions & 10 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -75,18 +75,17 @@ ifneq ($(MAKECMDGOALS),clean)
ifeq ($(OS),Darwin)
NODE_HEADER=/usr/local/include/node
else
NODE_VERSION=$(shell node -v|sed -E -e 's/[^0-9]*([0-9]*).*/\1/')
ifdef MXE
NODE_HEADER=/usr/include/node$(NODE_VERSION)
NODE_API+=node-api.o
else
ifeq ($(OS),CYGWIN)
NODE_API+=node-api.o
endif
NODE_HEADER=$(call search,include/node$(NODE_VERSION))
ifeq ($(NODE_HEADER),) # Ubuntu stashes node headers at /usr/include/nodejs
NODE_HEADER=$(call search,include/node)
endif
endif
ifeq ($(OS),CYGWIN)
NODE_API+=node-api.o
endif
NODE_VERSION=$(shell node -v|sed -E -e 's/[^0-9]*([0-9]*).*/\1/')
nsearch=$(firstword $(foreach dir,$(DIRS) /usr,$(wildcard $(dir)/$(1))))
NODE_HEADER=$(call nsearch,include/node$(NODE_VERSION))
ifeq ($(NODE_HEADER),) # Ubuntu stashes node headers at /usr/include/nodejs, also if node version doesn't match, create a link in your include search path (eg ~/usr/include/node
NODE_HEADER=$(call nsearch,include/node)
endif
endif
# if we haven't found an installed version of the Node SDK, then
Expand Down
2 changes: 1 addition & 1 deletion RavelCAPI
Submodule RavelCAPI updated 2 files
+2 −2 Makefile
+1 −1 civita

0 comments on commit 19bd894

Please sign in to comment.