Merge branch 'master' into next

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

View file

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

View file

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

View file

@ -36,7 +36,7 @@
#include <stdlib.h>
#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

View file

@ -117,11 +117,12 @@ 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"))
add_framework(CoreFoundation SRB2SDL2)
add_framework(SDL2 SRB2SDL2)
add_framework(SDL2_mixer SRB2SDL2)
if(${CMAKE_SYSTEM} MATCHES Darwin)
find_library(CORE_LIB CoreFoundation)
target_link_libraries(SRB2SDL2 PRIVATE
${CORE_LIB}
SDL2
SDL2_mixer
${GME_LIBRARIES}
${PNG_LIBRARIES}
${ZLIB_LIBRARIES}
@ -227,7 +228,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 +269,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\"

View file

@ -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;

View file

@ -15,6 +15,8 @@
#include <string.h>
#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