-
-
Notifications
You must be signed in to change notification settings - Fork 196
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Update Makefile build_release to work around issues with static linki…
…ng library dependencies and duplicate symbols (#493)
- Loading branch information
1 parent
bf905a0
commit 57b576f
Showing
1 changed file
with
19 additions
and
6 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,9 +1,22 @@ | ||
RELEASE_BUILD_FLAGS=-c release --disable-sandbox --arch x86_64 --arch arm64 | ||
BIN_PATH=$(shell swift build $(RELEASE_BUILD_FLAGS) --show-bin-path)/periphery | ||
BUILD_PATH=.build | ||
SWIFT_BUILD_FLAGS=--configuration release --disable-sandbox --build-path ${BUILD_PATH} | ||
|
||
build_release: | ||
@swift build $(RELEASE_BUILD_FLAGS) | ||
@install_name_tool -add_rpath @loader_path ${BIN_PATH} | ||
EXECUTABLE_X86_64=$(shell swift build ${SWIFT_BUILD_FLAGS} --arch x86_64 --show-bin-path)/periphery | ||
EXECUTABLE_ARM64=$(shell swift build ${SWIFT_BUILD_FLAGS} --arch arm64 --show-bin-path)/periphery | ||
EXECUTABLE=${BUILD_PATH}/periphery | ||
|
||
clean: | ||
@swift package clean | ||
|
||
build_x86_64: | ||
@swift build ${SWIFT_BUILD_FLAGS} --arch x86_64 | ||
|
||
build_arm64: | ||
@swift build ${SWIFT_BUILD_FLAGS} --arch arm64 | ||
|
||
build_release: clean build_x86_64 build_arm64 | ||
@lipo -create -output ${EXECUTABLE} ${EXECUTABLE_X86_64} ${EXECUTABLE_ARM64} | ||
@strip -rSTX ${EXECUTABLE} | ||
|
||
show_bin_path: | ||
@echo ${BIN_PATH} | ||
@echo ${EXECUTABLE} |