Skip to content

Commit 0306bda

Browse files
committed
iOS targets fix
1 parent 0d8b8d2 commit 0306bda

File tree

7 files changed

+25
-40
lines changed

7 files changed

+25
-40
lines changed

commandLine/src/addons/ofAddon.cpp

Lines changed: 9 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -773,6 +773,14 @@ void ofAddon::addToFolder(const fs::path& path, const fs::path & parentFolder){
773773
filesToFolders[path] = folder;
774774
}
775775

776+
777+
void ofAddon::prepareForWrite() {
778+
removeDuplicates(libs);
779+
removeDuplicates(libFiles);
780+
removeDuplicates(frameworks);
781+
removeDuplicates(xcframeworks);
782+
}
783+
776784
void ofAddon::parseLibsPath(const fs::path & libsPath, const fs::path & parentFolder) {
777785
if (!fs::exists(libsPath)) {
778786
// alert("file not found " + libsPath.string(), 35);
@@ -781,7 +789,7 @@ void ofAddon::parseLibsPath(const fs::path & libsPath, const fs::path & parentFo
781789
// alert ("parseLibsPath " + libsPath.string() + ", parent=" + parentFolder.string(), 35);
782790

783791

784-
if (platform == "osx" || platform == "macos"){
792+
if (platform == "osx" || platform == "macos" || platform == "ios" || platform == "tvos"){
785793
// Horrible hack to make it work with the bad idea of renaming osx to macos
786794
getLibsRecursively(libsPath, libFiles, libs, "macos");
787795
getLibsRecursively(libsPath, libFiles, libs, "osx");
@@ -802,15 +810,6 @@ void ofAddon::parseLibsPath(const fs::path & libsPath, const fs::path & parentFo
802810
getLibsRecursively(libsPath, libFiles, libs, platform);
803811
}
804812

805-
if (//platform == "osx" ||
806-
platform == "ios" ||
807-
platform == "tvos"){//} ||
808-
//platform == "macos"){
809-
810-
getFrameworksRecursively(libsPath, platform);
811-
// getXCFrameworksRecursively(libsPath, platform);
812-
}
813-
814813
if (platform == "vs" || platform == "msys2"
815814
|| platform == "vscode"
816815
|| platform == "linux"

commandLine/src/addons/ofAddon.h

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,24 +25,32 @@ const vector<string> parseStates {
2525
"common",
2626
"linux",
2727
"linux64",
28+
"linux/64",
2829
"msys2",
2930
"vs",
3031
"linuxarmv6l",
3132
"linuxarmv7l",
3233
"linuxaarch64",
34+
"linux/armv6l",
35+
"linux/armv7l",
36+
"linux/aarch64",
37+
"linux/arm64",
3338
"android/armeabi",
3439
"android/armeabi-v7a",
3540
"android/arm64-v8a",
3641
"android/x86",
3742
"android/x86_64",
3843
"emscripten",
44+
"emscripten/32",
45+
"emscripten/64",
3946
"android",
4047
"ios",
4148
"osx",
4249
"tvos",
4350
"macos",
4451
"watchos",
4552
"visionos",
53+
"catos",
4654
};
4755

4856

@@ -136,6 +144,7 @@ class ofAddon {
136144

137145
bool load(string addonName, const fs::path& projectDir, const string& targetPlatform);
138146

147+
void prepareForWrite();
139148

140149
void clear();
141150

commandLine/src/defines.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
#define OFPROJECTGENERATOR_MAJOR_VERSION "0"
2-
#define OFPROJECTGENERATOR_MINOR_VERSION "86"
2+
#define OFPROJECTGENERATOR_MINOR_VERSION "87"
33
#define OFPROJECTGENERATOR_PATCH_VERSION "0"
44

55
#define PG_VERSION (OFPROJECTGENERATOR_MAJOR_VERSION "." OFPROJECTGENERATOR_MINOR_VERSION "." OFPROJECTGENERATOR_PATCH_VERSION)

commandLine/src/projects/baseProject.cpp

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -526,6 +526,8 @@ void baseProject::addAddon(ofAddon & addon){
526526
return;
527527
}
528528
}
529+
530+
addon.prepareForWrite();
529531

530532
/*
531533
@@ -556,6 +558,7 @@ void baseProject::addAddon(ofAddon & addon){
556558
}
557559
// alert("---> dependencies");
558560
addons.emplace_back(addon);
561+
559562

560563
//ofLogVerbose("baseProject") << "libs in addAddon " << addon.libs.size();
561564

@@ -578,7 +581,6 @@ void baseProject::addAddon(ofAddon & addon){
578581

579582
addAddonDefines(addon);
580583
addAddonFrameworks(addon);
581-
// addAddonXCFrameworks(addon);
582584
copyAddonData(addon);
583585
addAddonProps(addon);
584586
}

commandLine/src/projects/xcodeProject.cpp

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -642,9 +642,10 @@ void xcodeProject::addAddonFrameworks(const ofAddon& addon){
642642
ofLogVerbose("xcodeProject::addAddonFrameworks") << addon.name;
643643

644644
std::vector <std::string> allFrameworks;
645+
645646
allFrameworks.reserve( addon.frameworks.size() + addon.xcframeworks.size() );
646647
allFrameworks.insert( allFrameworks.end(), addon.frameworks.begin(), addon.frameworks.end() );
647-
allFrameworks.insert( allFrameworks.end(), addon.xcframeworks.begin(), addon.xcframeworks.end() );
648+
// allFrameworks.insert( allFrameworks.end(), addon.xcframeworks.begin(), addon.xcframeworks.end() );
648649

649650
for (auto & f : allFrameworks) {
650651
// for (auto & f : addon.frameworks) {

commandLine/src/utils/Utils.cpp

Lines changed: 0 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -637,28 +637,3 @@ bool containsSourceFiles(const fs::path& dir) {
637637
ofLogVerbose() << "No source files found in directory: [" << dir.string() << "]";
638638
return false;
639639
}
640-
641-
642-
// fs::path ofRelativeToOFPATH(const fs::path& path) {
643-
// try {
644-
// fs::path normalized_path = path;
645-
// std::string path_str = normalized_path.string();
646-
// #ifdef TARGET_WIN32
647-
// std::regex relative_pattern(R"((\.\.\\\.\.\\\.\.\\)|(\.\.\\\.\.\\\.\.))");
648-
// #else
649-
// std::regex relative_pattern(R"((\.\.\/\.\.\/\.\.\/))");
650-
// #endif
651-
// path_str = std::regex_replace(path_str, relative_pattern, "$(OF_PATH)/");
652-
// #ifdef TARGET_WIN32
653-
// fixSlashOrderPath(normalized_path);
654-
// #endif
655-
// return normalized_path;
656-
// } catch (const std::exception& ex) {
657-
// std::cout << "Canonical path for [" << path << "] threw exception:\n"
658-
// << ex.what() << '\n';
659-
// return fs::path("");
660-
// }
661-
// }
662-
663-
664-

commandLine/src/utils/Utils.h

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,7 @@ static std::map <ofTargetPlatform, std::string> platformsToString {
3131
{ OF_TARGET_ANDROID, "android" },
3232
// { OF_TARGET_EMSCRIPTEN, "" },
3333
{ OF_TARGET_IOS, "ios" },
34+
{ OF_TARGET_IOS, "tvos" },
3435
{ OF_TARGET_MACOS, "macos" },
3536
{ OF_TARGET_LINUX, "linux" },
3637
{ OF_TARGET_LINUX64, "linux64" },
@@ -150,8 +151,6 @@ std::string normalizePath(const std::string& path);
150151
fs::path normalizePath(const fs::path& path);
151152

152153
bool containsSourceFiles(const fs::path& dir);
153-
// fs::path ofRelativeToOFPATH(const fs::path& path);
154-
155154
/*
156155
Idea: create an object to hold the origin and destination files, with renames where needed
157156
and string substitution, so we can avoid opening and writing multiple times the same file, less ssd wear.

0 commit comments

Comments
 (0)