Skip to content

Commit 5a52470

Browse files
authored
XCode script to compile OF now in Project.xcconfig
1 parent 1640ef8 commit 5a52470

3 files changed

Lines changed: 10 additions & 2 deletions

File tree

libs/openFrameworksCompiled/project/osx/openFrameworksLib.xcodeproj/project.pbxproj

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -872,6 +872,7 @@
872872
runOnlyForDeploymentPostprocessing = 0;
873873
shellPath = "/usr/bin/env bash";
874874
shellScript = "#!/usr/bin/env bash\nif [ ! -d \"${SRCROOT}/../../../freetype/lib/macos/freetype.xcframework\" ]; then\n\techo \"openFrameworks has missing xcFrameworks for osx. Downloading libaries now via scripts/osx/download_libs.sh\"\n ${SRCROOT}/../../../../scripts/osx/download_libs.sh\nelse\n\techo \"xcFrameworks found\"\nfi\n";
875+
showEnvVarsInLog = 0;
875876
};
876877
BFF80A5D2C50B2C300784E74 /* ShellScript */ = {
877878
isa = PBXShellScriptBuildPhase;
@@ -890,6 +891,7 @@
890891
runOnlyForDeploymentPostprocessing = 0;
891892
shellPath = /bin/sh;
892893
shellScript = "#!/bin/sh\nTARGET_DIR=\"$SRCROOT/../../lib/macos\"\nATTRIBUTE_CHECK=$(xattr -p com.apple.xcode.CreatedByBuildSystem \"$TARGET_DIR\" 2>/dev/null)\nif [ -z \"$ATTRIBUTE_CHECK\" ]; then\n xattr -w com.apple.xcode.CreatedByBuildSystem true \"$TARGET_DIR\"\n echo \"Attribute com.apple.xcode.CreatedByBuildSystem set to true for $TARGET_DIR\"\nelse\n echo \"Attribute com.apple.xcode.CreatedByBuildSystem already set for $TARGET_DIR\"\nfi\n";
894+
showEnvVarsInLog = 0;
893895
};
894896
/* End PBXShellScriptBuildPhase section */
895897

scripts/templates/osx/Project.xcconfig

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -84,3 +84,8 @@ GCC_PREPROCESSOR_DEFINITIONS=$(inherited) $(USER_PREPROCESSOR_DEFINITIONS)
8484
OTHER_CFLAGS = $(OF_CORE_CFLAGS)
8585
OTHER_LDFLAGS = $(OF_CORE_LIBS) $(OF_CORE_FRAMEWORKS)
8686
HEADER_SEARCH_PATHS = $(OF_CORE_HEADERS)
87+
88+
//OF_CORE_BUILD_COMMAND = echo \"💾 Compiling openFrameworks\"\nxcodebuild -project \"$OF_PATH/libs/openFrameworksCompiled/project/osx/openFrameworksLib.xcodeproj\" -target openFrameworks -configuration \"${CONFIGURATION}\" CLANG_CXX_LANGUAGE_STANDARD=$CLANG_CXX_LANGUAGE_STANDARD MACOSX_DEPLOYMENT_TARGET=$MACOSX_DEPLOYMENT_TARGET GCC_PREPROCESSOR_DEFINITIONS='$USER_PREPROCESSOR_DEFINITIONS'
89+
90+
91+
OF_CORE_BUILD_COMMAND = xcodebuild -project $OF_PATH/libs/openFrameworksCompiled/project/osx/openFrameworksLib.xcodeproj -target openFrameworks -configuration ${CONFIGURATION} CLANG_CXX_LANGUAGE_STANDARD=$CLANG_CXX_LANGUAGE_STANDARD MACOSX_DEPLOYMENT_TARGET=$MACOSX_DEPLOYMENT_TARGET GCC_PREPROCESSOR_DEFINITIONS='$USER_PREPROCESSOR_DEFINITIONS'

scripts/templates/osx/emptyExample.xcodeproj/project.pbxproj

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,7 @@
3131
"outputPaths": [],
3232
"runOnlyForDeploymentPostprocessing": "0",
3333
"shellPath": "/usr/bin/env bash",
34+
"showEnvVarsInLog": "0",
3435
"shellScript": "#!/usr/bin/env bash\nif [ ! -d \"${OF_PATH}/libs/freetype/lib/macos/freetype.xcframework\" ]; then\n\techo \"openFrameworks has missing xcFrameworks for osx. Downloading libaries now via scripts/osx/download_libs.sh\"\n ${OF_PATH}/scripts/osx/download_libs.sh\nelse\n\techo \"xcFrameworks found\"\nfi\n"
3536
},
3637
"E42962A92163ECCD00A6A9E2": {
@@ -42,7 +43,7 @@
4243
"outputPaths": [],
4344
"isa": "PBXShellScriptBuildPhase",
4445
"runOnlyForDeploymentPostprocessing": "0",
45-
"shellScript": "echo \"💾 Compiling openFrameworks\"\nxcodebuild -project \"$OF_PATH/libs/openFrameworksCompiled/project/osx/openFrameworksLib.xcodeproj\" -target openFrameworks -configuration \"${CONFIGURATION}\" CLANG_CXX_LANGUAGE_STANDARD=$CLANG_CXX_LANGUAGE_STANDARD MACOSX_DEPLOYMENT_TARGET=$MACOSX_DEPLOYMENT_TARGET GCC_PREPROCESSOR_DEFINITIONS='$USER_PREPROCESSOR_DEFINITIONS'\n",
46+
"shellScript": "$OF_CORE_BUILD_COMMAND\n",
4647
"name": "Run Script — Compile OF",
4748
"files": []
4849
},
@@ -119,8 +120,8 @@
119120
"runOnlyForDeploymentPostprocessing": "0",
120121
"outputPaths": [],
121122
"shellPath": "/bin/sh",
122-
"inputFileListPaths": [],
123123
"showEnvVarsInLog": "0",
124+
"inputFileListPaths": [],
124125
"isa": "PBXShellScriptBuildPhase",
125126
"shellScript": "\"$OF_PATH/scripts/osx/xcode_project.sh\"\n",
126127
"files": [],

0 commit comments

Comments
 (0)