From 28a335b9eaa9dd4550cee8f329b99724fc75121c Mon Sep 17 00:00:00 2001 From: stephena Date: Sat, 8 Mar 2014 00:44:30 +0000 Subject: [PATCH] The OSX build files now support (and probably require) Xcode 5! There's still quite a few issues to fix, but at least it compiles and runs Stella correctly. git-svn-id: svn://svn.code.sf.net/p/stella/code/trunk@2869 8b62c5a3-ac7e-4cc8-8f21-d9a121418aba --- src/emucore/EventHandler.hxx | 2 +- src/macosx/Info-Stella.plist | 20 ++-- src/macosx/SDLMain.m | 6 +- src/macosx/SDLMain.nib/designable.nib | 2 +- .../TemplateInfo.plist | 0 .../project.pbxproj | 108 ++++++++++++------ 6 files changed, 85 insertions(+), 53 deletions(-) rename src/macosx/{stella_intel.xcodeproj => stella.xcodeproj}/TemplateInfo.plist (100%) rename src/macosx/{stella_intel.xcodeproj => stella.xcodeproj}/project.pbxproj (98%) diff --git a/src/emucore/EventHandler.hxx b/src/emucore/EventHandler.hxx index 41788c0de..1e8752692 100644 --- a/src/emucore/EventHandler.hxx +++ b/src/emucore/EventHandler.hxx @@ -179,7 +179,7 @@ class EventHandler #ifndef BSPF_MAC_OSX return (mod & KMOD_ALT); #else - return (mod & KMOD_META); + return (mod & KMOD_MODE); #endif } diff --git a/src/macosx/Info-Stella.plist b/src/macosx/Info-Stella.plist index bdb38cc3c..b90eccb47 100644 --- a/src/macosx/Info-Stella.plist +++ b/src/macosx/Info-Stella.plist @@ -4,6 +4,8 @@ CFBundleDevelopmentRegion English + CFBundleDisplayName + Stella CFBundleDocumentTypes @@ -32,8 +34,6 @@ CFBundleExecutable Stella - CFBundleDisplayName - Stella CFBundleGetInfoString Stella CFBundleHelpBookFolder @@ -54,20 +54,18 @@ StLa CFBundleVersion 3.9.3 + LSMinimumSystemVersionByArchitecture + + i386 + 10.4.0 + x86_64 + 10.6.0 + NSMainNibFile SDLMain.nib NSPrincipalClass NSApplication «PROJECTNAMEASXML» SDL Cocoa App - LSMinimumSystemVersionByArchitecture - - x86_64 - 10.6.0 - i386 - 10.4.0 - ppc - 10.4.0 - diff --git a/src/macosx/SDLMain.m b/src/macosx/SDLMain.m index 3a8629814..b0e6919ba 100644 --- a/src/macosx/SDLMain.m +++ b/src/macosx/SDLMain.m @@ -343,9 +343,9 @@ static void CustomApplicationMain (int argc, char **argv) - (NSString *)stringByReplacingRange:(NSRange)aRange with:(NSString *)aString { - unsigned int bufferSize; - unsigned int selfLen = [self length]; - unsigned int aStringLen = [aString length]; + NSUInteger bufferSize; + NSUInteger selfLen = [self length]; + NSUInteger aStringLen = [aString length]; unichar *buffer; NSRange localRange; NSString *result; diff --git a/src/macosx/SDLMain.nib/designable.nib b/src/macosx/SDLMain.nib/designable.nib index 994273134..ddbb86ff2 100644 --- a/src/macosx/SDLMain.nib/designable.nib +++ b/src/macosx/SDLMain.nib/designable.nib @@ -845,7 +845,7 @@ YES - stella_intel.xcodeproj + stella.xcodeproj 3 YES diff --git a/src/macosx/stella_intel.xcodeproj/TemplateInfo.plist b/src/macosx/stella.xcodeproj/TemplateInfo.plist similarity index 100% rename from src/macosx/stella_intel.xcodeproj/TemplateInfo.plist rename to src/macosx/stella.xcodeproj/TemplateInfo.plist diff --git a/src/macosx/stella_intel.xcodeproj/project.pbxproj b/src/macosx/stella.xcodeproj/project.pbxproj similarity index 98% rename from src/macosx/stella_intel.xcodeproj/project.pbxproj rename to src/macosx/stella.xcodeproj/project.pbxproj index 1d305c8d1..40762ec83 100644 --- a/src/macosx/stella_intel.xcodeproj/project.pbxproj +++ b/src/macosx/stella.xcodeproj/project.pbxproj @@ -220,9 +220,7 @@ 2D91750C09BA90380026E9FF /* InputDialog.cxx in Sources */ = {isa = PBXBuildFile; fileRef = 2D05FF60096E269100A518FE /* InputDialog.cxx */; }; 2D91750F09BA90380026E9FF /* Cocoa.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 1058C7A1FEA54F0111CA2CBB /* Cocoa.framework */; }; 2D91751009BA90380026E9FF /* OpenGL.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 2DEB3D4C0629BD24007EBBD3 /* OpenGL.framework */; }; - 2D91751109BA90380026E9FF /* SDL.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 2D4764C806683C5F00F63D87 /* SDL.framework */; }; 2D91751209BA90380026E9FF /* ApplicationServices.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 2D17D98E08BC398400E47F69 /* ApplicationServices.framework */; }; - 2D91751409BA90380026E9FF /* SDL.framework in CopyFiles */ = {isa = PBXBuildFile; fileRef = 2D4764C806683C5F00F63D87 /* SDL.framework */; }; 2DEFB40C09C3386F00754289 /* Cart.icns in Resources */ = {isa = PBXBuildFile; fileRef = 2DEFB40B09C3386F00754289 /* Cart.icns */; }; DC07A3C80CAD738A009B4BC9 /* StateManager.cxx in Sources */ = {isa = PBXBuildFile; fileRef = DC07A3C60CAD738A009B4BC9 /* StateManager.cxx */; }; DC07A3C90CAD738A009B4BC9 /* StateManager.hxx in Headers */ = {isa = PBXBuildFile; fileRef = DC07A3C70CAD738A009B4BC9 /* StateManager.hxx */; }; @@ -458,6 +456,8 @@ DCD6FC8211C281ED005DA767 /* pngwutil.c in Sources */ = {isa = PBXBuildFile; fileRef = DCD6FC6F11C281ED005DA767 /* pngwutil.c */; }; DCD6FC9311C28C6F005DA767 /* PNGLibrary.cxx in Sources */ = {isa = PBXBuildFile; fileRef = DCD6FC9111C28C6F005DA767 /* PNGLibrary.cxx */; }; DCD6FC9411C28C6F005DA767 /* PNGLibrary.hxx in Headers */ = {isa = PBXBuildFile; fileRef = DCD6FC9211C28C6F005DA767 /* PNGLibrary.hxx */; }; + DCDAF4D918CA9AAB00D3865D /* SDL2.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = DCDAF4D818CA9AAB00D3865D /* SDL2.framework */; }; + DCDAF4DB18CA9AF000D3865D /* SDL2.framework in CopyFiles */ = {isa = PBXBuildFile; fileRef = DCDAF4DA18CA9AF000D3865D /* SDL2.framework */; }; DCDE17FA17724E5D00EB1AC6 /* ConfigPathDialog.cxx in Sources */ = {isa = PBXBuildFile; fileRef = DCDE17F617724E5D00EB1AC6 /* ConfigPathDialog.cxx */; }; DCDE17FB17724E5D00EB1AC6 /* ConfigPathDialog.hxx in Headers */ = {isa = PBXBuildFile; fileRef = DCDE17F717724E5D00EB1AC6 /* ConfigPathDialog.hxx */; }; DCDE17FC17724E5D00EB1AC6 /* SnapshotDialog.cxx in Sources */ = {isa = PBXBuildFile; fileRef = DCDE17F817724E5D00EB1AC6 /* SnapshotDialog.cxx */; }; @@ -526,7 +526,7 @@ dstPath = ""; dstSubfolderSpec = 10; files = ( - 2D91751409BA90380026E9FF /* SDL.framework in CopyFiles */, + DCDAF4DB18CA9AF000D3865D /* SDL2.framework in CopyFiles */, ); runOnlyForDeploymentPostprocessing = 0; }; @@ -609,7 +609,7 @@ 2D6CC10308C811A600B8F642 /* TiaZoomWidget.cxx */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; name = TiaZoomWidget.cxx; path = ../debugger/gui/TiaZoomWidget.cxx; sourceTree = SOURCE_ROOT; }; 2D6CC10408C811A600B8F642 /* TiaZoomWidget.hxx */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.h; name = TiaZoomWidget.hxx; path = ../debugger/gui/TiaZoomWidget.hxx; sourceTree = SOURCE_ROOT; }; 2D733D6E062895B2006265D9 /* EventHandler.cxx */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; name = EventHandler.cxx; path = ../emucore/EventHandler.cxx; sourceTree = SOURCE_ROOT; }; - 2D733D6F062895B2006265D9 /* EventHandler.hxx */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.h; name = EventHandler.hxx; path = ../emucore/EventHandler.hxx; sourceTree = SOURCE_ROOT; }; + 2D733D6F062895B2006265D9 /* EventHandler.hxx */ = {isa = PBXFileReference; fileEncoding = 30; indentWidth = 2; lastKnownFileType = sourcecode.cpp.h; name = EventHandler.hxx; path = ../emucore/EventHandler.hxx; sourceTree = SOURCE_ROOT; tabWidth = 2; }; 2D733D70062895B2006265D9 /* FrameBuffer.cxx */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; name = FrameBuffer.cxx; path = ../emucore/FrameBuffer.cxx; sourceTree = SOURCE_ROOT; }; 2D733D71062895B2006265D9 /* FrameBuffer.hxx */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.h; name = FrameBuffer.hxx; path = ../emucore/FrameBuffer.hxx; sourceTree = SOURCE_ROOT; }; 2D733D77062895F1006265D9 /* Settings.hxx */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.h; name = Settings.hxx; path = ../emucore/Settings.hxx; sourceTree = SOURCE_ROOT; }; @@ -994,6 +994,8 @@ DCD6FC6F11C281ED005DA767 /* pngwutil.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; name = pngwutil.c; path = ../libpng/pngwutil.c; sourceTree = SOURCE_ROOT; }; DCD6FC9111C28C6F005DA767 /* PNGLibrary.cxx */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = PNGLibrary.cxx; path = ../common/PNGLibrary.cxx; sourceTree = SOURCE_ROOT; }; DCD6FC9211C28C6F005DA767 /* PNGLibrary.hxx */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; name = PNGLibrary.hxx; path = ../common/PNGLibrary.hxx; sourceTree = SOURCE_ROOT; }; + DCDAF4D818CA9AAB00D3865D /* SDL2.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = SDL2.framework; path = ../../../../../../Library/Frameworks/SDL2.framework; sourceTree = ""; }; + DCDAF4DA18CA9AF000D3865D /* SDL2.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = SDL2.framework; path = ../../../../../../Library/Frameworks/SDL2.framework; sourceTree = ""; }; DCDE17F617724E5D00EB1AC6 /* ConfigPathDialog.cxx */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = ConfigPathDialog.cxx; path = ../gui/ConfigPathDialog.cxx; sourceTree = SOURCE_ROOT; }; DCDE17F717724E5D00EB1AC6 /* ConfigPathDialog.hxx */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; name = ConfigPathDialog.hxx; path = ../gui/ConfigPathDialog.hxx; sourceTree = SOURCE_ROOT; }; DCDE17F817724E5D00EB1AC6 /* SnapshotDialog.cxx */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = SnapshotDialog.cxx; path = ../gui/SnapshotDialog.cxx; sourceTree = SOURCE_ROOT; }; @@ -1035,9 +1037,9 @@ isa = PBXFrameworksBuildPhase; buildActionMask = 2147483647; files = ( + DCDAF4D918CA9AAB00D3865D /* SDL2.framework in Frameworks */, 2D91750F09BA90380026E9FF /* Cocoa.framework in Frameworks */, 2D91751009BA90380026E9FF /* OpenGL.framework in Frameworks */, - 2D91751109BA90380026E9FF /* SDL.framework in Frameworks */, 2D91751209BA90380026E9FF /* ApplicationServices.framework in Frameworks */, ); runOnlyForDeploymentPostprocessing = 0; @@ -1089,6 +1091,7 @@ 29B97314FDCFA39411CA2CEA /* «PROJECTNAMEASXML» */ = { isa = PBXGroup; children = ( + DCDAF4DA18CA9AF000D3865D /* SDL2.framework */, DCA43BFF10DED5890070CEFD /* Info-Stella.plist */, 080E96DDFE201D6D7F000001 /* Classes */, 29B97315FDCFA39411CA2CEA /* Other Sources */, @@ -1131,6 +1134,7 @@ 29B97323FDCFA39411CA2CEA /* Frameworks */ = { isa = PBXGroup; children = ( + DCDAF4D818CA9AAB00D3865D /* SDL2.framework */, 1058C7A0FEA54F0111CA2CBB /* Linked Frameworks */, 1058C7A2FEA54F0111CA2CBB /* Other Frameworks */, ); @@ -1976,9 +1980,10 @@ 29B97313FDCFA39411CA2CEA /* Project object */ = { isa = PBXProject; attributes = { + LastUpgradeCheck = 0500; ORGANIZATIONNAME = net.sourceforge.stella; }; - buildConfigurationList = 2D91752109BA903B0026E9FF /* Build configuration list for PBXProject "stella_intel" */; + buildConfigurationList = 2D91752109BA903B0026E9FF /* Build configuration list for PBXProject "stella" */; compatibilityVersion = "Xcode 3.2"; developmentRegion = English; hasScannedForEncodings = 1; @@ -2265,9 +2270,11 @@ 2D91751709BA90380026E9FF /* Development */ = { isa = XCBuildConfiguration; buildSettings = { + COMBINE_HIDPI_IMAGES = YES; FRAMEWORK_SEARCH_PATHS = ( ., "$(HOME)/Library/Frameworks", + "$(LOCAL_LIBRARY_DIR)/Frameworks", ); GCC_DYNAMIC_NO_PIC = NO; GCC_ENABLE_FIX_AND_CONTINUE = NO; @@ -2287,7 +2294,7 @@ MAC_OSX, ); HEADER_SEARCH_PATHS = ( - ./SDL.framework/Headers, + /Library/Frameworks/SDL2.framework/Headers, ../cheat, ../common, ../common/tv_filters, @@ -2302,11 +2309,7 @@ INSTALL_PATH = "$(HOME)/Applications"; LIBRARY_SEARCH_PATHS = "$(LIBRARY_SEARCH_PATHS)"; OTHER_CFLAGS = ""; - OTHER_LDFLAGS = ( - "-framework", - SDL, - "-lz", - ); + OTHER_LDFLAGS = "-lz"; PRODUCT_NAME = Stella; SECTORDER_FLAGS = ""; WARNING_CFLAGS = ( @@ -2321,9 +2324,11 @@ 2D91751809BA90380026E9FF /* Deployment */ = { isa = XCBuildConfiguration; buildSettings = { + COMBINE_HIDPI_IMAGES = YES; FRAMEWORK_SEARCH_PATHS = ( ., "$(HOME)/Library/Frameworks", + "$(LOCAL_LIBRARY_DIR)/Frameworks", ); GCC_ENABLE_FIX_AND_CONTINUE = NO; GCC_GENERATE_DEBUGGING_SYMBOLS = NO; @@ -2342,7 +2347,7 @@ MAC_OSX, ); HEADER_SEARCH_PATHS = ( - ./SDL.framework/Headers, + /Library/Frameworks/SDL2.framework/Headers, ../cheat, ../common, ../common/tv_filters, @@ -2357,11 +2362,7 @@ INSTALL_PATH = "$(HOME)/Applications"; LIBRARY_SEARCH_PATHS = "$(LIBRARY_SEARCH_PATHS)"; OTHER_CFLAGS = ""; - OTHER_LDFLAGS = ( - "-framework", - SDL, - "-lz", - ); + OTHER_LDFLAGS = "-lz"; PRODUCT_NAME = Stella; SECTORDER_FLAGS = ""; WARNING_CFLAGS = ( @@ -2376,9 +2377,11 @@ 2D91751909BA90380026E9FF /* Default */ = { isa = XCBuildConfiguration; buildSettings = { + COMBINE_HIDPI_IMAGES = YES; FRAMEWORK_SEARCH_PATHS = ( "$(HOME)/Library/Frameworks", ., + "$(LOCAL_LIBRARY_DIR)/Frameworks", ); GCC_GENERATE_DEBUGGING_SYMBOLS = NO; GCC_OPTIMIZATION_LEVEL = 3; @@ -2396,7 +2399,7 @@ MAC_OSX, ); HEADER_SEARCH_PATHS = ( - ./SDL.framework/Headers, + /Library/Frameworks/SDL2.framework/Headers, ../cheat, ../common, ../common/tv_filters, @@ -2411,11 +2414,7 @@ INSTALL_PATH = "$(HOME)/Applications"; LIBRARY_SEARCH_PATHS = .; OTHER_CFLAGS = ""; - OTHER_LDFLAGS = ( - "-framework", - SDL, - "-lz", - ); + OTHER_LDFLAGS = "-lz"; PRODUCT_NAME = Stella; SECTORDER_FLAGS = ""; WARNING_CFLAGS = ( @@ -2430,7 +2429,12 @@ 2D91752209BA903B0026E9FF /* Development */ = { isa = XCBuildConfiguration; buildSettings = { - ARCHS = "$(ARCHS_STANDARD_32_64_BIT)"; + CLANG_WARN_BOOL_CONVERSION = YES; + CLANG_WARN_CONSTANT_CONVERSION = YES; + CLANG_WARN_EMPTY_BODY = YES; + CLANG_WARN_ENUM_CONVERSION = YES; + CLANG_WARN_INT_CONVERSION = YES; + CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; COPY_PHASE_STRIP = YES; DEBUG_INFORMATION_FORMAT = dwarf; FRAMEWORK_SEARCH_PATHS = ( @@ -2438,11 +2442,17 @@ "$(HOME)/Library/Frameworks", ); GCC_OPTIMIZATION_LEVEL = 0; - GCC_VERSION = com.apple.compilers.llvm.clang.1_0; + GCC_VERSION = ""; + GCC_WARN_64_TO_32_BIT_CONVERSION = YES; + GCC_WARN_ABOUT_RETURN_TYPE = YES; + GCC_WARN_UNDECLARED_SELECTOR = YES; + GCC_WARN_UNINITIALIZED_AUTOS = YES; + GCC_WARN_UNUSED_FUNCTION = YES; + GCC_WARN_UNUSED_VARIABLE = YES; INSTALL_PATH = "@rpath"; LD_RUNPATH_SEARCH_PATHS = "@loader_path/../Frameworks"; - MACOSX_DEPLOYMENT_TARGET = 10.6; - SDKROOT = macosx10.6; + MACOSX_DEPLOYMENT_TARGET = 10.5; + SDKROOT = macosx10.8; VALID_ARCHS = "i386 x86_64"; }; name = Development; @@ -2450,18 +2460,29 @@ 2D91752309BA903B0026E9FF /* Deployment */ = { isa = XCBuildConfiguration; buildSettings = { - ARCHS = "$(ARCHS_STANDARD_32_64_BIT)"; + CLANG_WARN_BOOL_CONVERSION = YES; + CLANG_WARN_CONSTANT_CONVERSION = YES; + CLANG_WARN_EMPTY_BODY = YES; + CLANG_WARN_ENUM_CONVERSION = YES; + CLANG_WARN_INT_CONVERSION = YES; + CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; FRAMEWORK_SEARCH_PATHS = ( ., "$(HOME)/Library/Frameworks", ); GCC_ENABLE_CPP_RTTI = NO; GCC_OPTIMIZATION_LEVEL = 3; - GCC_VERSION = com.apple.compilers.llvm.clang.1_0; + GCC_VERSION = ""; + GCC_WARN_64_TO_32_BIT_CONVERSION = YES; + GCC_WARN_ABOUT_RETURN_TYPE = YES; + GCC_WARN_UNDECLARED_SELECTOR = YES; + GCC_WARN_UNINITIALIZED_AUTOS = YES; + GCC_WARN_UNUSED_FUNCTION = YES; + GCC_WARN_UNUSED_VARIABLE = YES; INSTALL_PATH = "@rpath"; LD_RUNPATH_SEARCH_PATHS = "@loader_path/../Frameworks"; - MACOSX_DEPLOYMENT_TARGET = 10.6; - SDKROOT = macosx10.6; + MACOSX_DEPLOYMENT_TARGET = 10.5; + SDKROOT = macosx10.8; VALID_ARCHS = "i386 x86_64"; }; name = Deployment; @@ -2469,12 +2490,25 @@ 2D91752409BA903B0026E9FF /* Default */ = { isa = XCBuildConfiguration; buildSettings = { - ARCHS = "$(ARCHS_STANDARD_32_64_BIT)"; - GCC_VERSION = com.apple.compilers.llvm.clang.1_0; + CLANG_WARN_BOOL_CONVERSION = YES; + CLANG_WARN_CONSTANT_CONVERSION = YES; + CLANG_WARN_EMPTY_BODY = YES; + CLANG_WARN_ENUM_CONVERSION = YES; + CLANG_WARN_INT_CONVERSION = YES; + CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; + DEBUG_INFORMATION_FORMAT = dwarf; + FRAMEWORK_SEARCH_PATHS = /Library/Frameworks; + GCC_VERSION = ""; + GCC_WARN_64_TO_32_BIT_CONVERSION = YES; + GCC_WARN_ABOUT_RETURN_TYPE = YES; + GCC_WARN_UNDECLARED_SELECTOR = YES; + GCC_WARN_UNINITIALIZED_AUTOS = YES; + GCC_WARN_UNUSED_FUNCTION = YES; + GCC_WARN_UNUSED_VARIABLE = YES; INSTALL_PATH = "@rpath"; LD_RUNPATH_SEARCH_PATHS = "@loader_path/../Frameworks"; - MACOSX_DEPLOYMENT_TARGET = 10.6; - SDKROOT = macosx10.6; + MACOSX_DEPLOYMENT_TARGET = 10.5; + SDKROOT = macosx10.8; VALID_ARCHS = "i386 x86_64"; }; name = Default; @@ -2492,7 +2526,7 @@ defaultConfigurationIsVisible = 0; defaultConfigurationName = Default; }; - 2D91752109BA903B0026E9FF /* Build configuration list for PBXProject "stella_intel" */ = { + 2D91752109BA903B0026E9FF /* Build configuration list for PBXProject "stella" */ = { isa = XCConfigurationList; buildConfigurations = ( 2D91752209BA903B0026E9FF /* Development */,