Skip to content
Merged
Show file tree
Hide file tree
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
11 changes: 8 additions & 3 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -180,12 +180,17 @@ deps-quicktype-elm: verify-prereq-quicktype
gen: gen-c gen-python gen-javascript gen-java gen-haskell gen-rust gen-protobuf gen-jsonschema gen-quicktype
gen-quicktype: gen-quicktype-typescript gen-quicktype-elm

gen-c_args = -i $(SBP_SPEC_DIR) \
-o $(SWIFTNAV_ROOT)/c \
-r $(SBP_VERSION)
ifeq ($(SBP_STAGING), 1)
gen-c_args += -s
endif

Comment on lines +183 to +189
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Not the sure if it is the best approach to append a flag conditionally.

Copy link
Contributor

Choose a reason for hiding this comment

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

Seems fine, this makes the behavior more explicit

Copy link
Contributor

Choose a reason for hiding this comment

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

As an alternative I could see moving this behavior inside the generator an implicitly deciding if we're in a "staging" mode based on some environmental condition, but again, passing the switch makes the behavior more explicit

gen-c:
$(call announce-begin,"Generating C headers and sources")
cd $(SWIFTNAV_ROOT)/generator; \
$(SBP_GEN_BIN) -i $(SBP_SPEC_DIR) \
-o $(SWIFTNAV_ROOT)/c \
-r $(SBP_VERSION) \
$(SBP_GEN_BIN) $(gen-c_args) \
--c

$(call announce-begin,"Generating C tests")
Expand Down
Loading