Created
October 30, 2023 01:29
-
-
Save spencersalazar/fbb8095b9f093f058696f156b1d1563d to your computer and use it in GitHub Desktop.
Xcode custom build rule (.proto file)
This file contains hidden or 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
# | |
# Xcode custom build rule (protobuf .proto source file) | |
# | |
# add custom build rule to process "Protobuf source files" | |
# set to this script | |
# add to Output Files: $(DERIVED_FILE_DIR)/protobuf/$(INPUT_FILE_BASE).pb.cc | |
# | |
set -eu | |
# note: assumes protobuf installed via homebrew | |
export PATH=/opt/homebrew/bin:$PATH | |
OUT_DIR="$DERIVED_FILE_DIR/protobuf" | |
PROTO_PATH=$(dirname "$SCRIPT_INPUT_FILE") | |
mkdir -p "$OUT_DIR" | |
protoc "$SCRIPT_INPUT_FILE" --cpp_out="$OUT_DIR" --proto_path="$PROTO_PATH" | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment