From 4ab2c336e7e19c73a1a287802dc0e1f0969a55b8 Mon Sep 17 00:00:00 2001 From: Monster Iestyn Date: Sun, 6 Mar 2016 19:32:07 +0000 Subject: [PATCH 01/28] Possibly fixed the issues with LibGME mentioned in issue #14. Not even the HAVE_LIBGME macro was defined apparently, huh. --- cmake/Modules/FindGME.cmake | 8 ++++---- src/CMakeLists.txt | 1 + src/sdl/CMakeLists.txt | 3 +++ 3 files changed, 8 insertions(+), 4 deletions(-) diff --git a/cmake/Modules/FindGME.cmake b/cmake/Modules/FindGME.cmake index 3b0c68de7..ea80af454 100644 --- a/cmake/Modules/FindGME.cmake +++ b/cmake/Modules/FindGME.cmake @@ -6,16 +6,16 @@ find_path(GME_INCLUDE_DIR NAMES gme.h PATHS ${GME_PKGCONF_INCLUDE_DIRS} - /usr/include/gme - /usr/local/include/gme + "/usr/include/gme" + "/usr/local/include/gme" ) find_library(GME_LIBRARY NAMES gme PATHS ${GME_PKGCONF_LIBRARY_DIRS} - /usr/lib - /usr/local/lib + "/usr/lib" + "/usr/local/lib" ) set(GME_PROCESS_INCLUDES GME_INCLUDE_DIR) diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index d9e25dbb8..6ec8f2d71 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -314,6 +314,7 @@ if(${SRB2_CONFIG_HAVE_GME}) find_package(GME) if(${GME_FOUND}) set(SRB2_HAVE_GME ON) + add_definitions(-DHAVE_LIBGME) else() message(WARNING "You have specified that GME is available but it was not found.") endif() diff --git a/src/sdl/CMakeLists.txt b/src/sdl/CMakeLists.txt index b3d734521..7190efaac 100644 --- a/src/sdl/CMakeLists.txt +++ b/src/sdl/CMakeLists.txt @@ -122,6 +122,7 @@ if(${SDL2_FOUND}) add_framework(SDL2 SRB2SDL2) add_framework(SDL2_mixer SRB2SDL2) target_link_libraries(SRB2SDL2 PRIVATE + ${GME_LIBRARIES} ${PNG_LIBRARIES} ${ZLIB_LIBRARIES} ${OPENGL_LIBRARIES} @@ -131,6 +132,7 @@ if(${SDL2_FOUND}) target_link_libraries(SRB2SDL2 PRIVATE ${SDL2_LIBRARIES} ${SDL2_MIXER_LIBRARIES} + ${GME_LIBRARIES} ${PNG_LIBRARIES} ${ZLIB_LIBRARIES} ${OPENGL_LIBRARIES} @@ -198,6 +200,7 @@ if(${SDL2_FOUND}) target_include_directories(SRB2SDL2 PRIVATE ${SDL2_INCLUDE_DIRS} ${SDL2_MIXER_INCLUDE_DIRS} + ${GME_INCLUDE_DIRS} ${PNG_INCLUDE_DIRS} ${ZLIB_INCLUDE_DIRS} ${OPENGL_INCLUDE_DIRS} From eab51414f348470edfb7b84e2157db7d9b1af39d Mon Sep 17 00:00:00 2001 From: Monster Iestyn Date: Mon, 7 Mar 2016 21:16:02 +0000 Subject: [PATCH 02/28] Fix typo in A_ChangeAngleAbsolute --- src/p_enemy.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/p_enemy.c b/src/p_enemy.c index 367d5714a..ffb690822 100644 --- a/src/p_enemy.c +++ b/src/p_enemy.c @@ -7223,7 +7223,7 @@ void A_ChangeAngleAbsolute(mobj_t *actor) //const angle_t amin = FixedAngle(locvar1*FRACUNIT); //const angle_t amax = FixedAngle(locvar2*FRACUNIT); #ifdef HAVE_BLUA - if (LUA_CallAction("A_ChangeAngelAbsolute", actor)) + if (LUA_CallAction("A_ChangeAngleAbsolute", actor)) return; #endif From 509516f59f2711856c0edbbacbf6f3fa11de8b36 Mon Sep 17 00:00:00 2001 From: Alam Ed Arias Date: Thu, 10 Mar 2016 16:38:06 -0500 Subject: [PATCH 03/28] travis: enable apt and ccache cache --- .travis.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.travis.yml b/.travis.yml index c652584f8..5815e711f 100644 --- a/.travis.yml +++ b/.travis.yml @@ -10,6 +10,8 @@ compiler: - clang cache: + apt: true + ccache: true directories: - $HOME/srb2_cache From f9949a3026a7ac965c036a2e7c12bbc9f5627a4b Mon Sep 17 00:00:00 2001 From: Alam Ed Arias Date: Mon, 14 Mar 2016 12:24:51 -0400 Subject: [PATCH 04/28] dropping NOVERSION, you will not build SRB2 without a SCM --- src/Makefile | 5 ----- 1 file changed, 5 deletions(-) diff --git a/src/Makefile b/src/Makefile index d4cc64a4b..8520d8d5e 100644 --- a/src/Makefile +++ b/src/Makefile @@ -262,9 +262,7 @@ else OBJS+=$(OBJDIR)/hw3sound.o endif -ifndef NOVERSION OPTS += -DCOMPVERSION -endif ifndef NONX86 ifndef GCC29 @@ -550,9 +548,6 @@ cleandep: $(REMOVE) comptime.h pre-build: -ifdef NOVERSION - -@touch comptime.c -else ifdef WINDOWSHELL -..\comptime.bat . else From f5b56f2a076e89a59ad6fdcdb6e4c2e26f02c3e1 Mon Sep 17 00:00:00 2001 From: Alam Ed Arias Date: Mon, 14 Mar 2016 12:28:22 -0400 Subject: [PATCH 05/28] fixup --- src/Makefile | 1 - 1 file changed, 1 deletion(-) diff --git a/src/Makefile b/src/Makefile index 8520d8d5e..701cdcfb1 100644 --- a/src/Makefile +++ b/src/Makefile @@ -553,7 +553,6 @@ ifdef WINDOWSHELL else -@../comptime.sh . endif -endif clean: $(REMOVE) *~ *.flc From 2ecdd9e6f9ea891c7cead7f3331b1b626df2681b Mon Sep 17 00:00:00 2001 From: Inuyasha Date: Thu, 14 Jan 2016 04:31:48 -0800 Subject: [PATCH 06/28] Branch and revision information in builds Also makes comptime.bat work with git if able. Development builds will now show the branch and the SHA1 hash of the revision. Also been tested to work with subversion, where it displays "Subversion r####". You know, just in case. --- comptime.bat | 28 ++++++++++++++++++++++++---- comptime.sh | 10 +++++++--- src/comptime.c | 2 ++ src/d_netcmd.c | 4 ++++ src/doomdef.h | 7 +++++-- src/m_menu.c | 9 ++++++--- src/m_misc.c | 10 ++++------ 7 files changed, 52 insertions(+), 18 deletions(-) diff --git a/comptime.bat b/comptime.bat index 23ee7ea55..b8450ff64 100644 --- a/comptime.bat +++ b/comptime.bat @@ -1,10 +1,30 @@ @ECHO OFF -set REV=Unknown +set BRA=Unknown +set REV=illegal + copy nul: /b +%1\comptime.c tmp.$$$ > nul move tmp.$$$ %1\comptime.c > nul -SET REV=illegal -FOR /F "usebackq" %%s IN (`svnversion %1`) DO @SET REV=%%s + +if exist .git goto gitrev +if exist .svn goto svnrev +goto filwri + +:gitrev +set GIT=%2 +if "%GIT%"=="" set GIT=git +FOR /F "usebackq" %%s IN (`%GIT% rev-parse --abbrev-ref HEAD`) DO @SET BRA=%%s +FOR /F "usebackq" %%s IN (`%GIT% rev-parse HEAD`) DO @SET REV=%%s +set REV=%REV:~0,8% +goto filwri + +:svnrev +set BRA=Subversion +FOR /F "usebackq" %%s IN (`svnversion .`) DO @SET REV=%%s +goto filwri + +:filwri ECHO // Do not edit! This file was autogenerated > %1\comptime.h ECHO // by the %0 batch file >> %1\comptime.h ECHO // >> %1\comptime.h -ECHO const char* comprevision = "r%REV%"; >> %1\comptime.h +ECHO const char* compbranch = "%BRA%"; >> %1\comptime.h +ECHO const char* comprevision = "%REV%"; >> %1\comptime.h diff --git a/comptime.sh b/comptime.sh index 703bb2d35..71c5f08aa 100755 --- a/comptime.sh +++ b/comptime.sh @@ -5,13 +5,15 @@ if [ x"$1" != x ]; then fi versiongit() { - gitversion=`git describe` + gitbranch=`git rev-parse --abbrev-ref HEAD` + gitversion=`git rev-parse HEAD` cat < $path/comptime.h // Do not edit! This file was autogenerated -// by the $0 script with git svn +// by the $0 script with git // -const char* comprevision = "$gitversion"; +const char* compbranch = "$gitbranch"; +const char* comprevision = "${gitversion:0:8}"; EOF exit 0 } @@ -23,6 +25,7 @@ versionsvn() { // Do not edit! This file was autogenerated // by the $0 script with subversion // +const char* compbranch = "Subversion"; const char* comprevision = "r$svnrevision"; EOF exit 0 @@ -34,6 +37,7 @@ versionfake() { // Do not edit! This file was autogenerated // by the $0 script with an unknown or nonexist SCM // +const char* compbranch = "Unknown"; const char* comprevision = "illegal"; EOF } diff --git a/src/comptime.c b/src/comptime.c index a4dc5b0f9..9f1fe2f71 100644 --- a/src/comptime.c +++ b/src/comptime.c @@ -9,12 +9,14 @@ #if (defined(CMAKECONFIG)) #include "config.h" +const char *compbranch = ""; // hell if I know what to do with cmake const char *comprevision = SRB2_COMP_REVISION; #elif (defined(COMPVERSION)) #include "comptime.h" #else +const char *compbranch = "Unknown"; const char *comprevision = "illegal"; #endif diff --git a/src/d_netcmd.c b/src/d_netcmd.c index 266161c7c..30208422f 100644 --- a/src/d_netcmd.c +++ b/src/d_netcmd.c @@ -3179,7 +3179,11 @@ static void Command_ListWADS_f(void) */ static void Command_Version_f(void) { +#ifdef DEVELOP + CONS_Printf("Sonic Robo Blast 2 %s-%s (%s %s)\n", compbranch, comprevision, compdate, comptime); +#else CONS_Printf("Sonic Robo Blast 2 %s (%s %s %s)\n", VERSIONSTRING, compdate, comptime, comprevision); +#endif } #ifdef UPDATE_ALERT diff --git a/src/doomdef.h b/src/doomdef.h index e4b426ebc..fe7fad8ae 100644 --- a/src/doomdef.h +++ b/src/doomdef.h @@ -141,7 +141,10 @@ extern FILE *logstream; #if 0 #define VERSION 0 // Game version #define SUBVERSION 0 // more precise version number -#define VERSIONSTRING "Trunk" +#define VERSIONSTRING "Development EXE" +#define VERSIONSTRINGW L"Development EXE" +// most interface strings are ignored in development mode. +// we use comprevision and compbranch instead. #else #define VERSION 201 // Game version #define SUBVERSION 14 // more precise version number @@ -413,7 +416,7 @@ INT32 I_GetKey(void); #endif // Compile date and time and revision. -extern const char *compdate, *comptime, *comprevision; +extern const char *compdate, *comptime, *comprevision, *compbranch; // Disabled code and code under testing // None of these that are disabled in the normal build are guaranteed to work perfectly diff --git a/src/m_menu.c b/src/m_menu.c index 1e7745535..780de7ad5 100644 --- a/src/m_menu.c +++ b/src/m_menu.c @@ -2463,11 +2463,14 @@ void M_Drawer(void) V_DrawThinString(vid.dupx, vid.height - 9*vid.dupy, V_NOSCALESTART|V_TRANSLUCENT|V_ALLOWLOWERCASE, customversionstring); } else -#if VERSION > 0 || SUBVERSION > 0 + { +#ifdef DEVELOP // Development -- show revision / branch info + V_DrawThinString(vid.dupx, vid.height - 17*vid.dupy, V_NOSCALESTART|V_TRANSLUCENT|V_ALLOWLOWERCASE, compbranch); + V_DrawThinString(vid.dupx, vid.height - 9*vid.dupy, V_NOSCALESTART|V_TRANSLUCENT|V_ALLOWLOWERCASE, comprevision); +#else // Regular build V_DrawThinString(vid.dupx, vid.height - 9*vid.dupy, V_NOSCALESTART|V_TRANSLUCENT|V_ALLOWLOWERCASE, va("%s", VERSIONSTRING)); -#else // Trunk build, show revision info - V_DrawThinString(vid.dupx, vid.height - 9*vid.dupy, V_NOSCALESTART|V_TRANSLUCENT|V_ALLOWLOWERCASE, va("%s (%s)", VERSIONSTRING, comprevision)); #endif + } } } diff --git a/src/m_misc.c b/src/m_misc.c index 21728792f..22effdddf 100644 --- a/src/m_misc.c +++ b/src/m_misc.c @@ -1800,16 +1800,14 @@ UINT8 M_HighestBit(UINT32 num) const char *GetRevisionString(void) { - INT32 vinfo; - static char rev[8] = {0}; + static char rev[9] = {0}; if (rev[0]) return rev; - vinfo = atoi(&comprevision[1]); - if (vinfo) - snprintf(rev, 7, "r%d", vinfo); + if (comprevision[0] == 'r') + strncpy(rev, comprevision, 7); else - strcpy(rev, "rNULL"); + snprintf(rev, 7, "r%s", comprevision); rev[7] = '\0'; return rev; From 7e174290d7e2ade1a3dde14a77e9ab6e6a48bec0 Mon Sep 17 00:00:00 2001 From: Inuyasha Date: Thu, 14 Jan 2016 04:36:27 -0800 Subject: [PATCH 07/28] SVN needs the revision prefixed with 'r' --- comptime.bat | 1 + 1 file changed, 1 insertion(+) diff --git a/comptime.bat b/comptime.bat index b8450ff64..119b3bb5c 100644 --- a/comptime.bat +++ b/comptime.bat @@ -20,6 +20,7 @@ goto filwri :svnrev set BRA=Subversion FOR /F "usebackq" %%s IN (`svnversion .`) DO @SET REV=%%s +set REV=r%REV% goto filwri :filwri From 2f21c24d7703732a3e9a209991240d3850300484 Mon Sep 17 00:00:00 2001 From: Inuyasha Date: Sat, 16 Jan 2016 11:35:34 -0800 Subject: [PATCH 08/28] Makefile can run comptime.bat from src\ too --- comptime.bat | 1 + 1 file changed, 1 insertion(+) diff --git a/comptime.bat b/comptime.bat index 119b3bb5c..9e127f001 100644 --- a/comptime.bat +++ b/comptime.bat @@ -6,6 +6,7 @@ copy nul: /b +%1\comptime.c tmp.$$$ > nul move tmp.$$$ %1\comptime.c > nul if exist .git goto gitrev +if exist ..\.git goto gitrev if exist .svn goto svnrev goto filwri From 873fa10fe192ffc4a545b4fa129153f13ca311c4 Mon Sep 17 00:00:00 2001 From: Alam Ed Arias Date: Mon, 14 Mar 2016 17:47:02 -0400 Subject: [PATCH 09/28] comptime.bat: Windows 8.1 sucks --- comptime.bat | 17 ++++++++--------- 1 file changed, 8 insertions(+), 9 deletions(-) diff --git a/comptime.bat b/comptime.bat index 9e127f001..9028e2888 100644 --- a/comptime.bat +++ b/comptime.bat @@ -1,4 +1,3 @@ -@ECHO OFF set BRA=Unknown set REV=illegal @@ -13,20 +12,20 @@ goto filwri :gitrev set GIT=%2 if "%GIT%"=="" set GIT=git -FOR /F "usebackq" %%s IN (`%GIT% rev-parse --abbrev-ref HEAD`) DO @SET BRA=%%s -FOR /F "usebackq" %%s IN (`%GIT% rev-parse HEAD`) DO @SET REV=%%s +for /f "usebackq" %%s in (`%GIT% rev-parse --abbrev-ref HEAD`) do @set BRA=%%s +for /f "usebackq" %%s in (`%GIT% rev-parse HEAD`) do @set REV=%%s set REV=%REV:~0,8% goto filwri :svnrev set BRA=Subversion -FOR /F "usebackq" %%s IN (`svnversion .`) DO @SET REV=%%s +for /f "usebackq" %%s in (`svnversion .`) do @set REV=%%s set REV=r%REV% goto filwri :filwri -ECHO // Do not edit! This file was autogenerated > %1\comptime.h -ECHO // by the %0 batch file >> %1\comptime.h -ECHO // >> %1\comptime.h -ECHO const char* compbranch = "%BRA%"; >> %1\comptime.h -ECHO const char* comprevision = "%REV%"; >> %1\comptime.h +echo // Do not edit! This file was autogenerated > %1\comptime.h +echo // by the %0 batch file >> %1\comptime.h +echo // >> %1\comptime.h +echo const char* compbranch = "%BRA%"; >> %1\comptime.h +echo const char* comprevision = "%REV%"; >> %1\comptime.h From bbe93a6d31d9d9f7ac1c77c60800e9c2f2f5d810 Mon Sep 17 00:00:00 2001 From: wolfy852 Date: Mon, 14 Mar 2016 20:36:37 -0500 Subject: [PATCH 10/28] comptime.bat: Put @echo off back in --- comptime.bat | 1 + 1 file changed, 1 insertion(+) diff --git a/comptime.bat b/comptime.bat index 9028e2888..0c7ea06d6 100644 --- a/comptime.bat +++ b/comptime.bat @@ -1,3 +1,4 @@ +@echo off set BRA=Unknown set REV=illegal From c4e54d52e704ae16835237b039253c3428295547 Mon Sep 17 00:00:00 2001 From: Alam Ed Arias Date: Mon, 14 Mar 2016 21:54:53 -0400 Subject: [PATCH 11/28] comptime.bat: restore echo off --- comptime.bat | 1 + 1 file changed, 1 insertion(+) diff --git a/comptime.bat b/comptime.bat index 9028e2888..0c7ea06d6 100644 --- a/comptime.bat +++ b/comptime.bat @@ -1,3 +1,4 @@ +@echo off set BRA=Unknown set REV=illegal From 5dd0e533b37e980c273901d137f17061c70ec6dd Mon Sep 17 00:00:00 2001 From: Monster Iestyn Date: Tue, 15 Mar 2016 21:18:25 +0000 Subject: [PATCH 12/28] Removed unused "supdate" variable --- src/d_main.c | 2 -- src/d_main.h | 1 - 2 files changed, 3 deletions(-) diff --git a/src/d_main.c b/src/d_main.c index a959a8632..0a3fae3b5 100644 --- a/src/d_main.c +++ b/src/d_main.c @@ -509,7 +509,6 @@ static void D_Display(void) // ========================================================================= tic_t rendergametic; -boolean supdate; void D_SRB2Loop(void) { @@ -600,7 +599,6 @@ void D_SRB2Loop(void) // Update display, next frame, with current state. D_Display(); - supdate = false; if (moviemode) M_SaveFrame(); diff --git a/src/d_main.h b/src/d_main.h index 800b61f53..c5ce19ef4 100644 --- a/src/d_main.h +++ b/src/d_main.h @@ -17,7 +17,6 @@ #include "d_event.h" #include "w_wad.h" // for MAX_WADFILES -extern boolean supdate; extern boolean advancedemo; // make sure not to write back the config until it's been correctly loaded From 0953c9430b18bc8380aaf00f6871309a75c31a07 Mon Sep 17 00:00:00 2001 From: Alam Ed Arias Date: Fri, 25 Mar 2016 19:16:35 -0400 Subject: [PATCH 13/28] travis-ci: try osx building --- .travis.yml | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/.travis.yml b/.travis.yml index 5815e711f..e58f09513 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 14/28] travis-ci: add brew packages --- .travis.yml | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/.travis.yml b/.travis.yml index e58f09513..049d465a1 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 15/28] travis-ci: libpng, not libsdl --- .travis.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.travis.yml b/.travis.yml index 049d465a1..d70e1dc9a 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 16/28] 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 d70e1dc9a..bc5489308 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 17/28] 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 bc5489308..d131a82b2 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 18/28] travis-ci: fixup os list --- .travis.yml | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/.travis.yml b/.travis.yml index d131a82b2..4ebef34a0 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 19/28] 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 7190efaac..f44e3dee5 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 20/28] 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 8e7da6881..d833176f7 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 98599fb60..c3f0d3b38 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 21/28] 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 4ebef34a0..c7e8b66b0 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 22/28] 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 c7e8b66b0..e781c46e3 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 aeaac2cde..ba89c499b 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 436757309..19540547c 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 23/28] travis: fixup xml --- .travis.yml | 13 +++++-------- 1 file changed, 5 insertions(+), 8 deletions(-) diff --git a/.travis.yml b/.travis.yml index e781c46e3..88d47d485 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 24/28] travis: matrix is not correct --- .travis.yml | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/.travis.yml b/.travis.yml index 88d47d485..c378e9ef8 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 25/28] travis: steal SDL2 dmg for Mac build --- .travis.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.travis.yml b/.travis.yml index c378e9ef8..84bf5dea1 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 26/28] 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 84bf5dea1..df89593c4 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 f44e3dee5..f57aa2c1f 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 27/28] 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 f57aa2c1f..26448cb69 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 28/28] 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 26448cb69..7f6771262 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}