Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

build: fix building addons in debug mode #18301

Closed
wants to merge 1 commit into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -301,6 +301,10 @@ $(1)build/Release/.buildstamp: $(1)build/Makefile $(2) $(ADDON_PREREQS)
$(NODE_GYP) --directory=$(1) build
@touch $$@
$(1)build/Release/binding.node: $(1)build/Release/.buildstamp
$(1)build/Debug/.buildstamp: $(1)build/Makefile $(2) $(ADDON_PREREQS)
$(NODE_GYP) --directory=$(1) --debug build
@touch $$@
$(1)build/Debug/binding.node: $(1)build/Debug/.buildstamp
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could we reduce duplication by using $(BUILDTYPE)?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Wouldn't make much difference because you still need the rule that passes --debug to node-gyp.

You could unify them if the call to node-gyp build was replaced with make -C $(1)/build but that's somewhat unofficial.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

$(NODE_GYP) --directory=$(1) --$(BUILDTYPE) build?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Doesn't work; the argument is case-sensitive. I suppose you could use $(subst $(subst ...), ...) but that's arguably harder to read than ^.

endef

$(foreach x, $(ADDON_DIRS), \
Expand Down