Skip to content

Commit 5c23657

Browse files
authored
Addon lib fix and update npm dependencies (#516)
* Project Generator NPM Vulnerability fixes - Updates sub-dependancies * Addon libs - Fix XCFrameworks not linking correctly
1 parent 4ccfef2 commit 5c23657

5 files changed

Lines changed: 648 additions & 196 deletions

File tree

commandLine/Project.xcconfig

Lines changed: 17 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -12,18 +12,26 @@ MACOSX_DEPLOYMENT_TARGET = 10.15
1212
// App Settings
1313
PRODUCT_NAME = $(TARGET_NAME)
1414
PRODUCT_NAME[config=Debug] = $(TARGET_NAME)Debug
15-
PRODUCT_BUNDLE_IDENTIFIER = cc.openFrameworks.$(TARGET_NAME)
15+
PRODUCT_BUNDLE_IDENTIFIER = cc.openFrameworks.${TARGET_NAME:rfc1034identifier}
1616
//PRODUCT_BUNDLE_IDENTIFIER[config=Debug] = cc.openFrameworks.$(TARGET_NAME)Debug
1717
DEVELOPMENT_LANGUAGE = English
1818
CODE_SIGN_IDENTITY = -
1919
INFOPLIST_FILE = openFrameworks-Info.plist
20+
GENERATE_INFOPLIST_FILE = YES
21+
22+
// set application category to games, this is required to enable Game mode
23+
// note: this sets the initial value in the Xcode UI
24+
INFOPLIST_KEY_LSApplicationCategoryType = public.app-category.games
2025

2126
// VERSIONING - overridden if changed in Xcode UI
2227

2328
// this is "Version" in the Xcode target Identity UI
2429
// suggested to use semantic versioning format ala #.#.#
2530
MARKETING_VERSION = 0.1.0
2631

32+
// If users upgrade project to recommended settings it enables script sandboxing which breaks our post build script
33+
ENABLE_USER_SCRIPT_SANDBOXING=NO
34+
2735
// this is "Build" in the Xcode target Identity UI, an incremental build number
2836
// important for the App Store as new build submissions need a diff number even
2937
// if MARKETING_VERSION is the same
@@ -49,11 +57,6 @@ ICON_FILE = $(OF_PATH)/libs/openFrameworksCompiled/project/osx/$(ICON_NAME)
4957
// ex. change ICON_FILE_PATH = bin/data/ -> ICON_FILE = bin/data/$(ICON_NAME) &
5058
// in a custom openFrameworks-Info.plist, set CFBundleIconFile to ICON_NAME
5159

52-
//FOR AV ENGINE SOUND PLAYER UNCOMMENT TWO LINES BELOW
53-
//OF_NO_FMOD=1
54-
//USER_PREPROCESSOR_DEFINITIONS="OF_NO_FMOD=1"
55-
GCC_PREPROCESSOR_DEFINITIONS=$(inherited)$(USER_PREPROCESSOR_DEFINITIONS)
56-
5760
//APPSTORE, uncomment next lines to bundle data folder and code sign
5861
//OF_CODESIGN = 1
5962
//OF_BUNDLE_DATA_FOLDER = 1
@@ -66,9 +69,17 @@ GCC_PREPROCESSOR_DEFINITIONS=$(inherited)$(USER_PREPROCESSOR_DEFINITIONS)
6669
//OF_CORE_LIBS = $(inherited) $(LIB_BOOST_FS) $(LIB_BOOST_SYSTEM)
6770
//OF_CORE_HEADERS = $(inherited) $(HEADER_BOOST)
6871

72+
HIGH_RESOLUTION_CAPABLE = NO
73+
6974
// Optional include to keep any permanent settings as CODE_SIGN_IDENTITY.
7075
#include? "App.xcconfig"
7176

77+
//FOR AV ENGINE SOUND PLAYER UNCOMMENT THREE LINES BELOW
78+
//OF_NO_FMOD=1
79+
//USER_PREPROCESSOR_DEFINITIONS="OF_NO_FMOD=1"
80+
//LIB_FMOD=""
81+
GCC_PREPROCESSOR_DEFINITIONS=$(inherited) $(USER_PREPROCESSOR_DEFINITIONS)
82+
7283
OTHER_CFLAGS = $(OF_CORE_CFLAGS)
7384
OTHER_LDFLAGS = $(OF_CORE_LIBS) $(OF_CORE_FRAMEWORKS)
7485
HEADER_SEARCH_PATHS = $(OF_CORE_HEADERS)

commandLine/commandLine.xcodeproj/project.pbxproj

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,9 @@
1818
"7F2BBCD1-F22D-454A-9100-33D1C12BEA70" /* androidStudioProject.cpp in Sources */ = {isa = PBXBuildFile; fileRef = "FFD740F7-8E04-4563-A856-D4E402AF9C0E" /* androidStudioProject.cpp */; };
1919
"B07B8E19-F9DE-4E97-8833-859CD9267D30" /* LibraryBinary.cpp in Sources */ = {isa = PBXBuildFile; fileRef = "1EFA4702-B4F3-4556-9C12-4FE21FD503D0" /* LibraryBinary.cpp */; };
2020
"BCE6F361-0F3D-41FF-978D-B5ED6676D90B" /* LICENSE in Sources */ = {isa = PBXBuildFile; fileRef = "C97ACCE3-5F0E-4BEC-8BA9-2A532D9EA2E3" /* LICENSE */; };
21+
BF879F5D2C0F7CEB00200951 /* AVFoundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = BF879F5C2C0F7CEB00200951 /* AVFoundation.framework */; };
22+
BF879F5F2C0F7ED500200951 /* Foundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = BF879F5E2C0F7ED500200951 /* Foundation.framework */; };
23+
BF879F642C0F801100200951 /* SystemConfiguration.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = BF879F632C0F801100200951 /* SystemConfiguration.framework */; };
2124
"C2428661-BDEC-41D7-8150-C9BA5EE86C0C" /* visualStudioProject.cpp in Sources */ = {isa = PBXBuildFile; fileRef = "7BB75687-3F31-4D10-BE6A-C7918D1A678D" /* visualStudioProject.cpp */; };
2225
"DBD7E2AC-672A-4FD9-B0A4-DF24111D17FB" /* xcodeProject.cpp in Sources */ = {isa = PBXBuildFile; fileRef = "4CC7F503-61FC-435C-BA93-F9C1E6D46ABE" /* xcodeProject.cpp */; };
2326
E4B69E200A3A1BDC003C02F2 /* main.cpp in Sources */ = {isa = PBXBuildFile; fileRef = E4B69E1D0A3A1BDC003C02F2 /* main.cpp */; };
@@ -72,6 +75,9 @@
7275
"9314E210-0C9D-4025-9840-CD8122E2DC3D" /* LibraryBinary.h */ = {isa = PBXFileReference; explicitFileType = sourcecode.c.h; fileEncoding = 4; name = LibraryBinary.h; path = src/utils/LibraryBinary.h; sourceTree = SOURCE_ROOT; };
7376
"9FAE80C7-5F2A-4E9D-9487-9E2667DE93DA" /* Utils.h */ = {isa = PBXFileReference; explicitFileType = sourcecode.c.h; fileEncoding = 4; name = Utils.h; path = src/utils/Utils.h; sourceTree = SOURCE_ROOT; };
7477
"AB662ACC-8DC1-4C81-A360-52F4CBF8DFF9" /* App.xcconfig */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.xcconfig; path = App.xcconfig; sourceTree = "<group>"; };
78+
BF879F5C2C0F7CEB00200951 /* AVFoundation.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = AVFoundation.framework; path = System/Library/Frameworks/AVFoundation.framework; sourceTree = SDKROOT; };
79+
BF879F5E2C0F7ED500200951 /* Foundation.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Foundation.framework; path = System/Library/Frameworks/Foundation.framework; sourceTree = SDKROOT; };
80+
BF879F632C0F801100200951 /* SystemConfiguration.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = SystemConfiguration.framework; path = System/Library/Frameworks/SystemConfiguration.framework; sourceTree = SDKROOT; };
7581
"C0FADDD2-1DFA-4DC4-AC81-5877E59E42BF" /* ofAddon.h */ = {isa = PBXFileReference; explicitFileType = sourcecode.c.h; fileEncoding = 4; name = ofAddon.h; path = src/addons/ofAddon.h; sourceTree = SOURCE_ROOT; };
7682
"C5A3016A-B663-4FE7-B6E6-421C5F168447" /* qtcreatorproject.cpp */ = {isa = PBXFileReference; explicitFileType = sourcecode.cpp.cpp; fileEncoding = 4; name = qtcreatorproject.cpp; path = src/projects/qtcreatorproject.cpp; sourceTree = SOURCE_ROOT; };
7783
"C97ACCE3-5F0E-4BEC-8BA9-2A532D9EA2E3" /* LICENSE */ = {isa = PBXFileReference; explicitFileType = file; fileEncoding = 4; name = LICENSE; path = src/uuidxx/license/LICENSE; sourceTree = SOURCE_ROOT; };
@@ -92,6 +98,9 @@
9298
isa = PBXFrameworksBuildPhase;
9399
buildActionMask = 2147483647;
94100
files = (
101+
BF879F642C0F801100200951 /* SystemConfiguration.framework in Frameworks */,
102+
BF879F5F2C0F7ED500200951 /* Foundation.framework in Frameworks */,
103+
BF879F5D2C0F7CEB00200951 /* AVFoundation.framework in Frameworks */,
95104
);
96105
runOnlyForDeploymentPostprocessing = 0;
97106
};
@@ -173,6 +182,16 @@
173182
path = ../../../addons;
174183
sourceTree = "<group>";
175184
};
185+
BF879F5B2C0F7CEB00200951 /* Frameworks */ = {
186+
isa = PBXGroup;
187+
children = (
188+
BF879F632C0F801100200951 /* SystemConfiguration.framework */,
189+
BF879F5E2C0F7ED500200951 /* Foundation.framework */,
190+
BF879F5C2C0F7CEB00200951 /* AVFoundation.framework */,
191+
);
192+
name = Frameworks;
193+
sourceTree = "<group>";
194+
};
176195
"C833E973-D2D2-4055-A99B-34CB61CC572D" /* uuidxx */ = {
177196
isa = PBXGroup;
178197
children = (
@@ -194,6 +213,7 @@
194213
BB4B014C10F69532006C3DED /* addons */,
195214
E4B69B5B0A3A1756003C02F2 /* commandLineDebug.app */,
196215
"AB662ACC-8DC1-4C81-A360-52F4CBF8DFF9" /* App.xcconfig */,
216+
BF879F5B2C0F7CEB00200951 /* Frameworks */,
197217
);
198218
sourceTree = "<group>";
199219
};

commandLine/src/projects/xcodeProject.cpp

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -301,6 +301,16 @@ string xcodeProject::getFolderUUID(const fs::path & folder, bool isFolder, fs::p
301301
}
302302

303303
addCommand("Add :objects:"+thisUUID+":children array");
304+
305+
if (folder.begin()->string() == "addons") {
306+
addCommand("Add :objects:"+thisUUID+":sourceTree string <group>");
307+
fs::path addonFolder { fs::path(fullPath).filename() };
308+
addCommand("Add :objects:"+thisUUID+":path string " + ofPathToString(addonFolder));
309+
// alert ("group " + folder.string() + " : " + base.string() + " : " + addonFolder.string(), 32);
310+
} else {
311+
addCommand("Add :objects:"+thisUUID+":sourceTree string SOURCE_ROOT");
312+
}
313+
304314

305315
// Add this new folder to its parent, projRootUUID if root
306316
addCommand("Add :objects:"+lastFolderUUID+":children: string " + thisUUID);
@@ -357,6 +367,7 @@ void xcodeProject::addSrc(const fs::path & srcFile, const fs::path & folder, Src
357367
fp.addToResources = true;
358368
}
359369
}
370+
360371

361372
string UUID {
362373
addFile(srcFile, folder, fp)
@@ -423,7 +434,7 @@ void xcodeProject::addXCFramework(const fs::path & path, const fs::path & folder
423434
string parent { ofPathToString(path.parent_path()) };
424435

425436
for (auto & c : buildConfigs) {
426-
addCommand("Add :objects:" + c + ":buildSettings:FRAMEWORK_SEARCH_PATHS: string " + parent);
437+
addCommand("Add :objects:" + c + ":buildSettings:XFRAMEWORK_SEARCH_PATHS: string " + parent);
427438
}
428439
}
429440

0 commit comments

Comments
 (0)