Merge branch 'travis-ci'

This commit is contained in:
Alam Ed Arias 2016-03-25 22:37:27 -04:00
commit a3c01ea6c2
6 changed files with 23 additions and 10 deletions

View file

@ -2,8 +2,9 @@ language: c
sudo: required sudo: required
dist: trusty dist: trusty
env: os:
- CFLAGS=-Wno-absolute-value -Werror - linux
- osx
compiler: compiler:
- gcc - gcc
@ -32,4 +33,10 @@ before_script:
- cd build - cd build
- cmake .. - cmake ..
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 script: make

View file

@ -94,7 +94,6 @@ typedef long ssize_t;
#ifdef __APPLE_CC__ #ifdef __APPLE_CC__
#define DIRECTFULLSCREEN #define DIRECTFULLSCREEN
#define DEBUG_LOG #define DEBUG_LOG
#define HWRENDER
#define NOIPX #define NOIPX
#endif #endif

View file

@ -36,7 +36,7 @@
#include <stdlib.h> #include <stdlib.h>
#else #else
#ifndef HAVE_MEMCPY #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)) #define memcpy(d, s, n) bcopy ((s), (d), (n))
#endif #endif
#endif #endif

View file

@ -117,11 +117,12 @@ if(${SDL2_FOUND})
add_executable(SRB2SDL2 MACOSX_BUNDLE WIN32 ${SRB2_SDL2_TOTAL_SOURCES}) add_executable(SRB2SDL2 MACOSX_BUNDLE WIN32 ${SRB2_SDL2_TOTAL_SOURCES})
set_target_properties(SRB2SDL2 PROPERTIES OUTPUT_NAME ${SRB2_SDL2_EXE_NAME}) 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) find_library(CORE_LIB CoreFoundation)
add_framework(SDL2 SRB2SDL2)
add_framework(SDL2_mixer SRB2SDL2)
target_link_libraries(SRB2SDL2 PRIVATE target_link_libraries(SRB2SDL2 PRIVATE
${CORE_LIB}
SDL2
SDL2_mixer
${GME_LIBRARIES} ${GME_LIBRARIES}
${PNG_LIBRARIES} ${PNG_LIBRARIES}
${ZLIB_LIBRARIES} ${ZLIB_LIBRARIES}
@ -227,7 +228,7 @@ if(${SDL2_FOUND})
endif() endif()
#### Installation #### #### Installation ####
if (CMAKE_CXX_COMPILER_ID STREQUAL "AppleClang") if(${CMAKE_SYSTEM} MATCHES Darwin)
install(TARGETS SRB2SDL2 install(TARGETS SRB2SDL2
BUNDLE DESTINATION . BUNDLE DESTINATION .
) )
@ -268,7 +269,7 @@ if(${SDL2_FOUND})
# Mac bundle fixup # Mac bundle fixup
if (CMAKE_CXX_COMPILER_ID STREQUAL "AppleClang") if(${CMAKE_SYSTEM} MATCHES Darwin)
install(CODE " install(CODE "
include(BundleUtilities) include(BundleUtilities)
fixup_bundle(\"${CMAKE_INSTALL_PREFIX}/Sonic Robo Blast 2.app\" fixup_bundle(\"${CMAKE_INSTALL_PREFIX}/Sonic Robo Blast 2.app\"

View file

@ -1270,6 +1270,7 @@
HAVE_BLUA, HAVE_BLUA,
LUA_USE_POSIX, LUA_USE_POSIX,
COMPVERSION, COMPVERSION,
HWRENDER,
); );
GCC_THREADSAFE_STATICS = NO; GCC_THREADSAFE_STATICS = NO;
GCC_TREAT_IMPLICIT_FUNCTION_DECLARATIONS_AS_ERRORS = YES; GCC_TREAT_IMPLICIT_FUNCTION_DECLARATIONS_AS_ERRORS = YES;
@ -1392,6 +1393,7 @@
HAVE_BLUA, HAVE_BLUA,
LUA_USE_POSIX, LUA_USE_POSIX,
COMPVERSION, COMPVERSION,
HWRENDER,
); );
GCC_THREADSAFE_STATICS = NO; GCC_THREADSAFE_STATICS = NO;
GCC_TREAT_IMPLICIT_FUNCTION_DECLARATIONS_AS_ERRORS = YES; GCC_TREAT_IMPLICIT_FUNCTION_DECLARATIONS_AS_ERRORS = YES;

View file

@ -15,6 +15,8 @@
#include <string.h> #include <string.h>
#include "doomdef.h" #include "doomdef.h"
#if !defined (__APPLE__)
// Like the OpenBSD version, but it doesn't check for src not being a valid // Like the OpenBSD version, but it doesn't check for src not being a valid
// C string. // C string.
size_t strlcat(char *dst, const char *src, size_t siz) 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'; dst[0] = '\0';
return strlcat(dst, src, siz); return strlcat(dst, src, siz);
} }
#endif