From 0953c9430b18bc8380aaf00f6871309a75c31a07 Mon Sep 17 00:00:00 2001 From: Alam Ed Arias Date: Fri, 25 Mar 2016 19:16:35 -0400 Subject: [PATCH 01/16] travis-ci: try osx building --- .travis.yml | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/.travis.yml b/.travis.yml index 5815e711..e58f0951 100644 --- a/.travis.yml +++ b/.travis.yml @@ -1,6 +1,11 @@ language: c -sudo: required -dist: trusty + +matrix: + include: + - os: linux + dist: trusty + sudo: required + - os: osx env: - CFLAGS=-Wno-absolute-value -Werror From 73dd5cd8035c368d7858ee45fe0eeb1e24166766 Mon Sep 17 00:00:00 2001 From: Alam Ed Arias Date: Fri, 25 Mar 2016 19:48:39 -0400 Subject: [PATCH 02/16] travis-ci: add brew packages --- .travis.yml | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/.travis.yml b/.travis.yml index e58f0951..049d465a 100644 --- a/.travis.yml +++ b/.travis.yml @@ -37,4 +37,8 @@ before_script: - cd build - cmake .. +before_install: + - if [[ "$TRAVIS_OS_NAME" == "osx" ]]; then brew update ; fi + - if [[ "$TRAVIS_OS_NAME" == "osx" ]]; then brew install sdl2_mixer libsdl game-music-emu p7zip ; fi + script: make From 8d36a77e42c092f8108248a17ccca20f6af9110f Mon Sep 17 00:00:00 2001 From: Alam Ed Arias Date: Fri, 25 Mar 2016 19:53:13 -0400 Subject: [PATCH 03/16] travis-ci: libpng, not libsdl --- .travis.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.travis.yml b/.travis.yml index 049d465a..d70e1dc9 100644 --- a/.travis.yml +++ b/.travis.yml @@ -1,10 +1,10 @@ language: c +sudo: required matrix: include: - os: linux dist: trusty - sudo: required - os: osx env: @@ -39,6 +39,6 @@ before_script: before_install: - if [[ "$TRAVIS_OS_NAME" == "osx" ]]; then brew update ; fi - - if [[ "$TRAVIS_OS_NAME" == "osx" ]]; then brew install sdl2_mixer libsdl game-music-emu p7zip ; fi + - if [[ "$TRAVIS_OS_NAME" == "osx" ]]; then brew install sdl2_mixer libpng game-music-emu p7zip ; fi script: make From dfa41ed8782ea24485bcfa2f3d4066bc14b6d2c9 Mon Sep 17 00:00:00 2001 From: Alam Ed Arias Date: Fri, 25 Mar 2016 19:56:05 -0400 Subject: [PATCH 04/16] travis-ci: drop libpng for osx --- .travis.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.travis.yml b/.travis.yml index d70e1dc9..bc548930 100644 --- a/.travis.yml +++ b/.travis.yml @@ -39,6 +39,6 @@ before_script: before_install: - if [[ "$TRAVIS_OS_NAME" == "osx" ]]; then brew update ; fi - - if [[ "$TRAVIS_OS_NAME" == "osx" ]]; then brew install sdl2_mixer libpng game-music-emu p7zip ; fi + - if [[ "$TRAVIS_OS_NAME" == "osx" ]]; then brew install sdl2_mixer game-music-emu p7zip ; fi script: make From 9162e7da9d59f869bf99691a2f381f405ae0629d Mon Sep 17 00:00:00 2001 From: Alam Ed Arias Date: Fri, 25 Mar 2016 19:56:51 -0400 Subject: [PATCH 05/16] travis-ci: move dist setting to top --- .travis.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.travis.yml b/.travis.yml index bc548930..d131a82b 100644 --- a/.travis.yml +++ b/.travis.yml @@ -1,10 +1,10 @@ language: c sudo: required +dist: trusty matrix: include: - os: linux - dist: trusty - os: osx env: From 23c9892fea6af16054f82d8eb3f295f590c11448 Mon Sep 17 00:00:00 2001 From: Alam Ed Arias Date: Fri, 25 Mar 2016 20:02:57 -0400 Subject: [PATCH 06/16] travis-ci: fixup os list --- .travis.yml | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/.travis.yml b/.travis.yml index d131a82b..4ebef34a 100644 --- a/.travis.yml +++ b/.travis.yml @@ -2,10 +2,9 @@ language: c sudo: required dist: trusty -matrix: - include: - - os: linux - - os: osx +os: + - linux + - osx env: - CFLAGS=-Wno-absolute-value -Werror From 0c9081f762dd5d4cbcdcfe3871bcc599fbefc316 Mon Sep 17 00:00:00 2001 From: Alam Ed Arias Date: Fri, 25 Mar 2016 20:10:14 -0400 Subject: [PATCH 07/16] cmake: try to fixup mac build --- src/sdl/CMakeLists.txt | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/sdl/CMakeLists.txt b/src/sdl/CMakeLists.txt index 7190efaa..f44e3dee 100644 --- a/src/sdl/CMakeLists.txt +++ b/src/sdl/CMakeLists.txt @@ -117,7 +117,7 @@ if(${SDL2_FOUND}) add_executable(SRB2SDL2 MACOSX_BUNDLE WIN32 ${SRB2_SDL2_TOTAL_SOURCES}) set_target_properties(SRB2SDL2 PROPERTIES OUTPUT_NAME ${SRB2_SDL2_EXE_NAME}) - if((CMAKE_CXX_COMPILER_ID STREQUAL "AppleClang")) + if(${CMAKE_SYSTEM} MATCHES Darwin) add_framework(CoreFoundation SRB2SDL2) add_framework(SDL2 SRB2SDL2) add_framework(SDL2_mixer SRB2SDL2) @@ -227,7 +227,7 @@ if(${SDL2_FOUND}) endif() #### Installation #### - if (CMAKE_CXX_COMPILER_ID STREQUAL "AppleClang") + if(${CMAKE_SYSTEM} MATCHES Darwin) install(TARGETS SRB2SDL2 BUNDLE DESTINATION . ) @@ -268,7 +268,7 @@ if(${SDL2_FOUND}) # Mac bundle fixup - if (CMAKE_CXX_COMPILER_ID STREQUAL "AppleClang") + if(${CMAKE_SYSTEM} MATCHES Darwin) install(CODE " include(BundleUtilities) fixup_bundle(\"${CMAKE_INSTALL_PREFIX}/Sonic Robo Blast 2.app\" From dadf8e1260a83125089f43ba2a6ddb119f2a474a Mon Sep 17 00:00:00 2001 From: Alam Ed Arias Date: Fri, 25 Mar 2016 20:21:56 -0400 Subject: [PATCH 08/16] cmake: remove fixed HWRENDER define --- src/doomtype.h | 1 - src/sdl/macosx/Srb2mac.xcodeproj/project.pbxproj | 2 ++ 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/src/doomtype.h b/src/doomtype.h index 8e7da688..d833176f 100644 --- a/src/doomtype.h +++ b/src/doomtype.h @@ -94,7 +94,6 @@ typedef long ssize_t; #ifdef __APPLE_CC__ #define DIRECTFULLSCREEN #define DEBUG_LOG -#define HWRENDER #define NOIPX #endif diff --git a/src/sdl/macosx/Srb2mac.xcodeproj/project.pbxproj b/src/sdl/macosx/Srb2mac.xcodeproj/project.pbxproj index 98599fb6..c3f0d3b3 100644 --- a/src/sdl/macosx/Srb2mac.xcodeproj/project.pbxproj +++ b/src/sdl/macosx/Srb2mac.xcodeproj/project.pbxproj @@ -1270,6 +1270,7 @@ HAVE_BLUA, LUA_USE_POSIX, COMPVERSION, + HWRENDER, ); GCC_THREADSAFE_STATICS = NO; GCC_TREAT_IMPLICIT_FUNCTION_DECLARATIONS_AS_ERRORS = YES; @@ -1392,6 +1393,7 @@ HAVE_BLUA, LUA_USE_POSIX, COMPVERSION, + HWRENDER, ); GCC_THREADSAFE_STATICS = NO; GCC_TREAT_IMPLICIT_FUNCTION_DECLARATIONS_AS_ERRORS = YES; From 2165c6806661ccdc3d854dae3e528a5e9ed339f3 Mon Sep 17 00:00:00 2001 From: Alam Ed Arias Date: Fri, 25 Mar 2016 20:25:52 -0400 Subject: [PATCH 09/16] travis: add -Wno-unknown-warning-option --- .travis.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.travis.yml b/.travis.yml index 4ebef34a..c7e8b66b 100644 --- a/.travis.yml +++ b/.travis.yml @@ -7,7 +7,7 @@ os: - osx env: -- CFLAGS=-Wno-absolute-value -Werror +- CFLAGS=-Wno-absolute-value -Wno-unknown-warning-option -Werror compiler: - gcc From 18f51b343b17d0ce70b271a3c6a832ab9cf9028a Mon Sep 17 00:00:00 2001 From: Alam Ed Arias Date: Fri, 25 Mar 2016 20:37:14 -0400 Subject: [PATCH 10/16] build: more mac fixes --- .travis.yml | 2 ++ src/md5.c | 2 +- src/string.c | 4 ++++ 3 files changed, 7 insertions(+), 1 deletion(-) diff --git a/.travis.yml b/.travis.yml index c7e8b66b..e781c46e 100644 --- a/.travis.yml +++ b/.travis.yml @@ -4,7 +4,9 @@ dist: trusty os: - linux + env: CFLAGS=-Wno-absolute-value -Werror - osx + env: CFLAGS=--Werror env: - CFLAGS=-Wno-absolute-value -Wno-unknown-warning-option -Werror diff --git a/src/md5.c b/src/md5.c index aeaac2cd..ba89c499 100644 --- a/src/md5.c +++ b/src/md5.c @@ -36,7 +36,7 @@ #include #else #ifndef HAVE_MEMCPY - #if !((defined (_WIN32) || defined (_WIN32_WCE)) && !defined (__CYGWIN__)) + #if !((defined (_WIN32) || defined (_WIN32_WCE)) && !defined (__CYGWIN__)) && !defined (__APPLE__) #define memcpy(d, s, n) bcopy ((s), (d), (n)) #endif #endif diff --git a/src/string.c b/src/string.c index 43675730..19540547 100644 --- a/src/string.c +++ b/src/string.c @@ -15,6 +15,8 @@ #include #include "doomdef.h" +#if !defined (__APPLE__) + // Like the OpenBSD version, but it doesn't check for src not being a valid // C string. size_t strlcat(char *dst, const char *src, size_t siz) @@ -46,3 +48,5 @@ size_t strlcpy(char *dst, const char *src, size_t siz) dst[0] = '\0'; return strlcat(dst, src, siz); } + +#endif From fc1d71454b0c7ccdf3071a34e586ab27918c5c4d Mon Sep 17 00:00:00 2001 From: Alam Ed Arias Date: Fri, 25 Mar 2016 20:56:04 -0400 Subject: [PATCH 11/16] travis: fixup xml --- .travis.yml | 13 +++++-------- 1 file changed, 5 insertions(+), 8 deletions(-) diff --git a/.travis.yml b/.travis.yml index e781c46e..88d47d48 100644 --- a/.travis.yml +++ b/.travis.yml @@ -2,14 +2,11 @@ language: c sudo: required dist: trusty -os: - - linux - env: CFLAGS=-Wno-absolute-value -Werror - - osx - env: CFLAGS=--Werror - -env: -- CFLAGS=-Wno-absolute-value -Wno-unknown-warning-option -Werror +matrix: + include: + - os: linux + env: CFLAGS=Wno-absolute-value -Werror + - osx compiler: - gcc From 7122908560818ff3d36d862243983fa28c07e652 Mon Sep 17 00:00:00 2001 From: Alam Ed Arias Date: Fri, 25 Mar 2016 20:57:57 -0400 Subject: [PATCH 12/16] travis: matrix is not correct --- .travis.yml | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/.travis.yml b/.travis.yml index 88d47d48..c378e9ef 100644 --- a/.travis.yml +++ b/.travis.yml @@ -2,11 +2,9 @@ language: c sudo: required dist: trusty -matrix: - include: - - os: linux - env: CFLAGS=Wno-absolute-value -Werror - - osx +os: + - linux + - osx compiler: - gcc From 9bc6ce3d85b3d353a4d14df9b78d292c65de602e Mon Sep 17 00:00:00 2001 From: Alam Ed Arias Date: Fri, 25 Mar 2016 21:43:17 -0400 Subject: [PATCH 13/16] travis: steal SDL2 dmg for Mac build --- .travis.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.travis.yml b/.travis.yml index c378e9ef..84bf5dea 100644 --- a/.travis.yml +++ b/.travis.yml @@ -36,5 +36,7 @@ before_script: before_install: - if [[ "$TRAVIS_OS_NAME" == "osx" ]]; then brew update ; fi - if [[ "$TRAVIS_OS_NAME" == "osx" ]]; then brew install sdl2_mixer game-music-emu p7zip ; fi + - if [[ "$TRAVIS_OS_NAME" == "osx" ]]; then curl -O -L https://www.libsdl.org/release/SDL2-2.0.4.dmg; hdiutil attach SDL2-2.0.4.dmg; sudo cp -a /Volumes/SDL2/SDL2.framework /Library/Frameworks/; fi + - if [[ "$TRAVIS_OS_NAME" == "osx" ]]; then curl -O -L https://www.libsdl.org/projects/SDL_mixer/release/SDL2_mixer-2.0.1.dmg; hdiutil attach SDL2_mixer-2.0.1.dmg; sudo cp -a /Volumes/SDL2_mixer/SDL2_mixer.framework /Library/Frameworks/; fi script: make From 2c4a27c7c6c2262debab568f5b0c466bf740b4c8 Mon Sep 17 00:00:00 2001 From: Alam Ed Arias Date: Fri, 25 Mar 2016 22:07:34 -0400 Subject: [PATCH 14/16] macosx: let fix linking to SDL frameworks --- .travis.yml | 2 +- src/sdl/CMakeLists.txt | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/.travis.yml b/.travis.yml index 84bf5dea..df89593c 100644 --- a/.travis.yml +++ b/.travis.yml @@ -37,6 +37,6 @@ before_install: - if [[ "$TRAVIS_OS_NAME" == "osx" ]]; then brew update ; fi - if [[ "$TRAVIS_OS_NAME" == "osx" ]]; then brew install sdl2_mixer game-music-emu p7zip ; fi - if [[ "$TRAVIS_OS_NAME" == "osx" ]]; then curl -O -L https://www.libsdl.org/release/SDL2-2.0.4.dmg; hdiutil attach SDL2-2.0.4.dmg; sudo cp -a /Volumes/SDL2/SDL2.framework /Library/Frameworks/; fi - - if [[ "$TRAVIS_OS_NAME" == "osx" ]]; then curl -O -L https://www.libsdl.org/projects/SDL_mixer/release/SDL2_mixer-2.0.1.dmg; hdiutil attach SDL2_mixer-2.0.1.dmg; sudo cp -a /Volumes/SDL2_mixer/SDL2_mixer.framework /Library/Frameworks/; fi + - if [[ "$TRAVIS_OS_NAME" == "osx" ]]; then curl -O -L https://www.libsdl.org/projects/SDL_mixer/release/SDL2_mixer-2.0.1.dmg; hdiutil attach SDL2_mixer-2.0.1.dmg; sudo cp -a /Volumes/SDL2_mixer/SDL2_mixer.framework /Library/Frameworks/; fi script: make diff --git a/src/sdl/CMakeLists.txt b/src/sdl/CMakeLists.txt index f44e3dee..f57aa2c1 100644 --- a/src/sdl/CMakeLists.txt +++ b/src/sdl/CMakeLists.txt @@ -118,10 +118,10 @@ if(${SDL2_FOUND}) set_target_properties(SRB2SDL2 PROPERTIES OUTPUT_NAME ${SRB2_SDL2_EXE_NAME}) if(${CMAKE_SYSTEM} MATCHES Darwin) - add_framework(CoreFoundation SRB2SDL2) - add_framework(SDL2 SRB2SDL2) - add_framework(SDL2_mixer SRB2SDL2) target_link_libraries(SRB2SDL2 PRIVATE + CoreFoundation + SDL2 + SDL2_mixer ${GME_LIBRARIES} ${PNG_LIBRARIES} ${ZLIB_LIBRARIES} From 077781cc567d1b7b6bee96abbba652fea0b121da Mon Sep 17 00:00:00 2001 From: Alam Ed Arias Date: Fri, 25 Mar 2016 22:11:39 -0400 Subject: [PATCH 15/16] macosx: drop CoreFoundation linking --- src/sdl/CMakeLists.txt | 1 - 1 file changed, 1 deletion(-) diff --git a/src/sdl/CMakeLists.txt b/src/sdl/CMakeLists.txt index f57aa2c1..26448cb6 100644 --- a/src/sdl/CMakeLists.txt +++ b/src/sdl/CMakeLists.txt @@ -119,7 +119,6 @@ if(${SDL2_FOUND}) if(${CMAKE_SYSTEM} MATCHES Darwin) target_link_libraries(SRB2SDL2 PRIVATE - CoreFoundation SDL2 SDL2_mixer ${GME_LIBRARIES} From 0f853640e219bda4a2af3406d1fdade541be88ad Mon Sep 17 00:00:00 2001 From: Alam Ed Arias Date: Fri, 25 Mar 2016 22:23:47 -0400 Subject: [PATCH 16/16] macosx: We need CoreFoudation for SDLMain --- src/sdl/CMakeLists.txt | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/sdl/CMakeLists.txt b/src/sdl/CMakeLists.txt index 26448cb6..7f677126 100644 --- a/src/sdl/CMakeLists.txt +++ b/src/sdl/CMakeLists.txt @@ -118,7 +118,9 @@ if(${SDL2_FOUND}) set_target_properties(SRB2SDL2 PROPERTIES OUTPUT_NAME ${SRB2_SDL2_EXE_NAME}) if(${CMAKE_SYSTEM} MATCHES Darwin) + find_library(CORE_LIB CoreFoundation) target_link_libraries(SRB2SDL2 PRIVATE + ${CORE_LIB} SDL2 SDL2_mixer ${GME_LIBRARIES}