@@ -503,6 +503,57 @@ void xcodeProject::addFramework(string name, string path, string folder){
503
503
}
504
504
}
505
505
506
+ void xcodeProject::addDylib (string name, string path){
507
+ // name = name of the dylib
508
+ // path = the full path (w name) of this framework
509
+ // folder = the path in the addon (in case we want to add this to the file browser -- we don't do that for system libs);
510
+
511
+ // -----------------------------------------------------------------
512
+ // based on the extension make some choices about what to do:
513
+ // -----------------------------------------------------------------
514
+
515
+ // -----------------------------------------------------------------
516
+ // (A) make a FILE REF
517
+ // -----------------------------------------------------------------
518
+
519
+ // encoding may be messing up for frameworks... so I switched to a pbx file ref without encoding fields
520
+ string UUID = generateUUID ( name );
521
+
522
+ // commands.emplace_back("Add :objects:"+UUID+":fileEncoding string 4");
523
+ commands.emplace_back (" Add :objects:" +UUID+" :path string " +path);
524
+ commands.emplace_back (" Add :objects:" +UUID+" :isa string PBXFileReference" );
525
+ commands.emplace_back (" Add :objects:" +UUID+" :name string " +name);
526
+ commands.emplace_back (" Add :objects:" +UUID+" :lastKnownFileType string compiled.mach-o.dylib" );
527
+ commands.emplace_back (" Add :objects:" +UUID+" :sourceTree string SOURCE_ROOT" );
528
+
529
+ string buildUUID = generateUUID (name + " -build" );
530
+ commands.emplace_back (" Add :objects:" +buildUUID+" :isa string PBXBuildFile" );
531
+ commands.emplace_back (" Add :objects:" +buildUUID+" :fileRef string " +UUID);
532
+
533
+ // new - code sign dylibs on copy
534
+ commands.emplace_back (" Add :objects:" +buildUUID+" :settings:ATTRIBUTES array" );
535
+ commands.emplace_back (" Add :objects:" +buildUUID+" :settings:ATTRIBUTES: string CodeSignOnCopy" );
536
+
537
+ // // we add one of the build refs to the list of frameworks
538
+ // // TENTATIVA desesperada aqui...
539
+ // string folderUUID = getFolderUUID(folder);
540
+ // commands.emplace_back("Add :objects:"+folderUUID+":children: string " + UUID);
541
+
542
+ string buildUUID2 = generateUUID (name + " -build2" );
543
+ commands.emplace_back (" Add :objects:" +buildUUID2+" :fileRef string " +UUID);
544
+ commands.emplace_back (" Add :objects:" +buildUUID2+" :isa string PBXBuildFile" );
545
+
546
+ // new - code sign frameworks on copy
547
+ commands.emplace_back (" Add :objects:" +buildUUID2+" :settings:ATTRIBUTES array" );
548
+ commands.emplace_back (" Add :objects:" +buildUUID2+" :settings:ATTRIBUTES: string CodeSignOnCopy" );
549
+
550
+ // UUID hardcoded para PBXCopyFilesBuildPhase
551
+ // FIXME: hardcoded - this is the same for the next fixme. so maybe a clearer ident can make things better here.
552
+ commands.emplace_back (" Add :objects:E4A5B60F29BAAAE400C2D356:files: string " + buildUUID2);
553
+
554
+ }
555
+
556
+
506
557
void xcodeProject::addInclude (string includeName){
507
558
508
559
// string relRoot = getOFRelPathFS(projectDir).string();
@@ -602,6 +653,9 @@ void xcodeProject::addAddon(ofAddon & addon){
602
653
for (auto & e : addon.libs ) {
603
654
ofLogVerbose () << " adding addon libs: " << e.path ;
604
655
addLibrary (e);
656
+ if ( ofFilePath::getFileExt (e.path ) == " dylib" ){
657
+ addDylib (ofFilePath::getFileName (e.path ), e.path );
658
+ }
605
659
}
606
660
607
661
for (auto & e : addon.cflags ) {
0 commit comments