2020 *
2121 */
2222
23+ #include " config.h"
2324#include " xcode.h"
2425
2526#include < fstream>
@@ -86,34 +87,34 @@ XCodeProvider::XCodeProvider(StringList &global_warnings, std::map<std::string,
8687
8788void XCodeProvider::createWorkspace (const BuildSetup &setup) {
8889 // Create project folder
89- std::string workspace = setup.outputDir + ' /' + " scummvm .xcodeproj" ;
90+ std::string workspace = setup.outputDir + ' /' + PROJECT_NAME " .xcodeproj" ;
9091
9192#if defined(_WIN32) || defined(WIN32)
9293 if (!CreateDirectory (workspace.c_str (), NULL ))
9394 if (GetLastError () != ERROR_ALREADY_EXISTS)
94- error (" Could not create folder \" " + setup.outputDir + ' /' + " scummvm .xcodeproj\" " );
95+ error (" Could not create folder \" " + setup.outputDir + ' /' + PROJECT_NAME " .xcodeproj\" " );
9596#else
9697 if (mkdir (workspace.c_str (), 0777 ) == -1 ) {
9798 if (errno == EEXIST) {
9899 // Try to open as a folder (might be a file / symbolic link)
99100 DIR *dirp = opendir (workspace.c_str ());
100101 if (dirp == NULL ) {
101- error (" Could not create folder \" " + setup.outputDir + ' /' + " scummvm .xcodeproj\" " );
102+ error (" Could not create folder \" " + setup.outputDir + ' /' + PROJECT_NAME " .xcodeproj\" " );
102103 } else {
103104 // The folder exists, just close the stream and return
104105 closedir (dirp);
105106 }
106107 } else {
107- error (" Could not create folder \" " + setup.outputDir + ' /' + " scummvm .xcodeproj\" " );
108+ error (" Could not create folder \" " + setup.outputDir + ' /' + PROJECT_NAME " .xcodeproj\" " );
108109 }
109110 }
110111#endif
111112
112113 // Setup global objects
113114 setupDefines (setup);
114- _targets.push_back (" ScummVM -iPhone" );
115- _targets.push_back (" ScummVM -OS X" );
116- _targets.push_back (" ScummVM -Simulator" );
115+ _targets.push_back (PROJECT_DESCRIPTION " -iPhone" );
116+ _targets.push_back (PROJECT_DESCRIPTION " -OS X" );
117+ _targets.push_back (PROJECT_DESCRIPTION " -Simulator" );
117118
118119 setupCopyFilesBuildPhase ();
119120 setupFrameworksBuildPhase ();
@@ -153,9 +154,9 @@ void XCodeProvider::createProjectFile(const std::string &, const std::string &,
153154// Main Project file
154155// ////////////////////////////////////////////////////////////////////////
155156void XCodeProvider::ouputMainProjectFile (const BuildSetup &setup) {
156- std::ofstream project ((setup.outputDir + ' /' + " scummvm .xcodeproj" + ' /' + " project.pbxproj" ).c_str ());
157+ std::ofstream project ((setup.outputDir + ' /' + PROJECT_NAME " .xcodeproj" + ' /' + " project.pbxproj" ).c_str ());
157158 if (!project)
158- error (" Could not open \" " + setup.outputDir + ' /' + " scummvm .xcodeproj" + ' /' + " project.pbxproj\" for writing" );
159+ error (" Could not open \" " + setup.outputDir + ' /' + PROJECT_NAME " .xcodeproj" + ' /' + " project.pbxproj\" for writing" );
159160
160161 // ////////////////////////////////////////////////////////////////////////
161162 // Header
@@ -392,8 +393,8 @@ void XCodeProvider::setupNativeTarget() {
392393 target->addProperty (" dependencies" , " " , " " , SettingsNoValue|SettingsAsList);
393394
394395 target->addProperty (" name" , _targets[i], " " , SettingsNoValue|SettingsQuoteVariable);
395- target->addProperty (" productName" , " scummvm " , " " , SettingsNoValue);
396- target->addProperty (" productReference" , getHash (" PBXFileReference_ScummVM .app_" + _targets[i]), " ScummVM .app" , SettingsNoValue);
396+ target->addProperty (" productName" , PROJECT_NAME , " " , SettingsNoValue);
397+ target->addProperty (" productReference" , getHash (" PBXFileReference_ " PROJECT_DESCRIPTION " .app_" + _targets[i]), PROJECT_DESCRIPTION " .app" , SettingsNoValue);
397398 target->addProperty (" productType" , " com.apple.product-type.application" , " " , SettingsNoValue|SettingsQuoteVariable);
398399
399400 _nativeTarget.add (target);
@@ -405,7 +406,7 @@ void XCodeProvider::setupProject() {
405406
406407 Object *project = new Object (this , " PBXProject" , " PBXProject" , " PBXProject" , " " , " Project object" );
407408
408- project->addProperty (" buildConfigurationList" , getHash (" XCConfigurationList_scummvm" ), " Build configuration list for PBXProject \" scummvm \" " , SettingsNoValue);
409+ project->addProperty (" buildConfigurationList" , getHash (" XCConfigurationList_scummvm" ), " Build configuration list for PBXProject \" " PROJECT_NAME " \" " , SettingsNoValue);
409410 project->addProperty (" compatibilityVersion" , " Xcode 3.2" , " " , SettingsNoValue|SettingsQuoteVariable);
410411 project->addProperty (" developmentRegion" , " English" , " " , SettingsNoValue);
411412 project->addProperty (" hasScannedForEncodings" , " 1" , " " , SettingsNoValue);
@@ -495,8 +496,8 @@ void XCodeProvider::setupResourcesBuildPhase() {
495496 }
496497
497498 // Add custom files depending on the target
498- if (_targets[i] == " ScummVM -OS X" ) {
499- files.settings [getHash (" PBXResources_scummvm .icns" )] = Setting (" " , " scummvm .icns in Resources" , SettingsNoValue, 0 , 6 );
499+ if (_targets[i] == PROJECT_DESCRIPTION " -OS X" ) {
500+ files.settings [getHash (" PBXResources_ " PROJECT_NAME " .icns" )] = Setting (" " , PROJECT_NAME " .icns in Resources" , SettingsNoValue, 0 , 6 );
500501
501502 // Remove 2 iphone icon files
502503 files.settings .erase (getHash (" PBXResources_Default.png" ));
@@ -526,7 +527,7 @@ void XCodeProvider::setupBuildConfiguration() {
526527 // ****************************************/
527528
528529 // Debug
529- Object *iPhone_Debug_Object = new Object (this , " XCBuildConfiguration_ScummVM -iPhone_Debug" , _targets[0 ] /* ScummVM-iPhone */ , " XCBuildConfiguration" , " PBXNativeTarget" , " Debug" );
530+ Object *iPhone_Debug_Object = new Object (this , " XCBuildConfiguration_ " PROJECT_DESCRIPTION " -iPhone_Debug" , _targets[0 ] /* ScummVM-iPhone */ , " XCBuildConfiguration" , " PBXNativeTarget" , " Debug" );
530531 Property iPhone_Debug;
531532 ADD_SETTING_QUOTE (iPhone_Debug, " ARCHS" , " $(ARCHS_UNIVERSAL_IPHONE_OS)" );
532533 ADD_SETTING_QUOTE (iPhone_Debug, " CODE_SIGN_IDENTITY" , " iPhone Developer" );
@@ -558,7 +559,7 @@ void XCodeProvider::setupBuildConfiguration() {
558559 ADD_SETTING_LIST (iPhone_Debug, " LIBRARY_SEARCH_PATHS" , iPhone_LibPaths, SettingsAsList, 5 );
559560 ADD_SETTING (iPhone_Debug, " ONLY_ACTIVE_ARCH" , " YES" );
560561 ADD_SETTING (iPhone_Debug, " PREBINDING" , " NO" );
561- ADD_SETTING (iPhone_Debug, " PRODUCT_NAME" , " ScummVM " );
562+ ADD_SETTING (iPhone_Debug, " PRODUCT_NAME" , PROJECT_DESCRIPTION );
562563 ADD_SETTING_QUOTE (iPhone_Debug, " PROVISIONING_PROFILE" , " EF590570-5FAC-4346-9071-D609DE2B28D8" );
563564 ADD_SETTING_QUOTE_VAR (iPhone_Debug, " PROVISIONING_PROFILE[sdk=iphoneos*]" , " " );
564565 ADD_SETTING (iPhone_Debug, " SDKROOT" , " iphoneos4.0" );
@@ -568,7 +569,7 @@ void XCodeProvider::setupBuildConfiguration() {
568569 iPhone_Debug_Object->properties [" buildSettings" ] = iPhone_Debug;
569570
570571 // Release
571- Object *iPhone_Release_Object = new Object (this , " XCBuildConfiguration_ScummVM -iPhone_Release" , _targets[0 ] /* ScummVM-iPhone */ , " XCBuildConfiguration" , " PBXNativeTarget" , " Release" );
572+ Object *iPhone_Release_Object = new Object (this , " XCBuildConfiguration_ " PROJECT_DESCRIPTION " -iPhone_Release" , _targets[0 ] /* ScummVM-iPhone */ , " XCBuildConfiguration" , " PBXNativeTarget" , " Release" );
572573 Property iPhone_Release (iPhone_Debug);
573574 ADD_SETTING (iPhone_Release, " GCC_OPTIMIZATION_LEVEL" , " 3" );
574575 ADD_SETTING (iPhone_Release, " COPY_PHASE_STRIP" , " YES" );
@@ -586,7 +587,7 @@ void XCodeProvider::setupBuildConfiguration() {
586587 ****************************************/
587588
588589 // Debug
589- Object *scummvm_Debug_Object = new Object (this , " XCBuildConfiguration_scummvm_Debug " , " scummvm " , " XCBuildConfiguration" , " PBXProject" , " Debug" );
590+ Object *scummvm_Debug_Object = new Object (this , " XCBuildConfiguration_ " PROJECT_NAME " _Debug " , PROJECT_NAME , " XCBuildConfiguration" , " PBXProject" , " Debug" );
590591 Property scummvm_Debug;
591592 ADD_SETTING (scummvm_Debug, " ALWAYS_SEARCH_USER_PATHS" , " NO" );
592593 ADD_SETTING_QUOTE (scummvm_Debug, " ARCHS" , " $(ARCHS_STANDARD_32_BIT)" );
@@ -623,7 +624,7 @@ void XCodeProvider::setupBuildConfiguration() {
623624 scummvm_Debug_Object->properties [" buildSettings" ] = scummvm_Debug;
624625
625626 // Release
626- Object *scummvm_Release_Object = new Object (this , " XCBuildConfiguration_scummvm_Release " , " scummvm " , " XCBuildConfiguration" , " PBXProject" , " Release" );
627+ Object *scummvm_Release_Object = new Object (this , " XCBuildConfiguration_ " PROJECT_NAME " _Release " , PROJECT_NAME , " XCBuildConfiguration" , " PBXProject" , " Release" );
627628 Property scummvm_Release (scummvm_Debug);
628629 REMOVE_SETTING (scummvm_Release, " GCC_C_LANGUAGE_STANDARD" ); // Not sure why we remove that, or any of the other warnings
629630 REMOVE_SETTING (scummvm_Release, " GCC_WARN_ABOUT_RETURN_TYPE" );
@@ -641,7 +642,7 @@ void XCodeProvider::setupBuildConfiguration() {
641642 ****************************************/
642643
643644 // Debug
644- Object *scummvmOSX_Debug_Object = new Object (this , " XCBuildConfiguration_ScummVM -OSX_Debug" , _targets[1 ] /* ScummVM-OS X */ , " XCBuildConfiguration" , " PBXNativeTarget" , " Debug" );
645+ Object *scummvmOSX_Debug_Object = new Object (this , " XCBuildConfiguration_ " PROJECT_DESCRIPTION " -OSX_Debug" , _targets[1 ] /* ScummVM-OS X */ , " XCBuildConfiguration" , " PBXNativeTarget" , " Debug" );
645646 Property scummvmOSX_Debug;
646647 ADD_SETTING_QUOTE (scummvmOSX_Debug, " ARCHS" , " $(NATIVE_ARCH)" );
647648 ADD_SETTING (scummvmOSX_Debug, " COMPRESS_PNG_FILES" , " NO" );
@@ -687,13 +688,13 @@ void XCodeProvider::setupBuildConfiguration() {
687688 scummvmOSX_LdFlags.push_back (" -lz" );
688689 ADD_SETTING_LIST (scummvmOSX_Debug, " OTHER_LDFLAGS" , scummvmOSX_LdFlags, SettingsAsList, 5 );
689690 ADD_SETTING (scummvmOSX_Debug, " PREBINDING" , " NO" );
690- ADD_SETTING (scummvmOSX_Debug, " PRODUCT_NAME" , " ScummVM " );
691+ ADD_SETTING (scummvmOSX_Debug, " PRODUCT_NAME" , PROJECT_DESCRIPTION );
691692
692693 scummvmOSX_Debug_Object->addProperty (" name" , " Debug" , " " , SettingsNoValue);
693694 scummvmOSX_Debug_Object->properties [" buildSettings" ] = scummvmOSX_Debug;
694695
695696 // Release
696- Object *scummvmOSX_Release_Object = new Object (this , " XCBuildConfiguration_ScummVMOSX_Release " , _targets[1 ] /* ScummVM-OS X */ , " XCBuildConfiguration" , " PBXNativeTarget" , " Release" );
697+ Object *scummvmOSX_Release_Object = new Object (this , " XCBuildConfiguration_ " PROJECT_DESCRIPTION " -OSX_Release " , _targets[1 ] /* ScummVM-OS X */ , " XCBuildConfiguration" , " PBXNativeTarget" , " Release" );
697698 Property scummvmOSX_Release (scummvmOSX_Debug);
698699 ADD_SETTING (scummvmOSX_Release, " COPY_PHASE_STRIP" , " YES" );
699700 REMOVE_SETTING (scummvmOSX_Release, " GCC_DYNAMIC_NO_PIC" );
@@ -711,7 +712,7 @@ void XCodeProvider::setupBuildConfiguration() {
711712 ****************************************/
712713
713714 // Debug
714- Object *scummvmSimulator_Debug_Object = new Object (this , " XCBuildConfiguration_ScummVM -Simulator_Debug" , _targets[2 ] /* ScummVM-Simulator */ , " XCBuildConfiguration" , " PBXNativeTarget" , " Debug" );
715+ Object *scummvmSimulator_Debug_Object = new Object (this , " XCBuildConfiguration_ " PROJECT_DESCRIPTION " -Simulator_Debug" , _targets[2 ] /* ScummVM-Simulator */ , " XCBuildConfiguration" , " PBXNativeTarget" , " Debug" );
715716 Property scummvmSimulator_Debug (iPhone_Debug);
716717 ADD_SETTING_QUOTE (scummvmSimulator_Debug, " FRAMEWORK_SEARCH_PATHS" , " $(inherited)" );
717718 ADD_SETTING_LIST (scummvmSimulator_Debug, " GCC_PREPROCESSOR_DEFINITIONS" , scummvm_defines, SettingsNoQuote|SettingsAsList, 5 );
@@ -722,7 +723,7 @@ void XCodeProvider::setupBuildConfiguration() {
722723 scummvmSimulator_Debug_Object->properties [" buildSettings" ] = scummvmSimulator_Debug;
723724
724725 // Release
725- Object *scummvmSimulator_Release_Object = new Object (this , " XCBuildConfiguration_ScummVM -Simulator_Release" , _targets[2 ] /* ScummVM-Simulator */ , " XCBuildConfiguration" , " PBXNativeTarget" , " Release" );
726+ Object *scummvmSimulator_Release_Object = new Object (this , " XCBuildConfiguration_ " PROJECT_DESCRIPTION " -Simulator_Release" , _targets[2 ] /* ScummVM-Simulator */ , " XCBuildConfiguration" , " PBXNativeTarget" , " Release" );
726727 Property scummvmSimulator_Release (scummvmSimulator_Debug);
727728 ADD_SETTING (scummvmSimulator_Release, " COPY_PHASE_STRIP" , " YES" );
728729 REMOVE_SETTING (scummvmSimulator_Release, " GCC_DYNAMIC_NO_PIC" );
0 commit comments