Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add macOS to travis builds, fix server-only builds on macOS, msc. fixes #3339

Merged
merged 4 commits into from
Jul 3, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
21 changes: 10 additions & 11 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,9 @@
#
sudo: false
language: cpp
os:
- linux
- osx
compiler:
- gcc
- clang
Expand Down Expand Up @@ -40,21 +43,17 @@ addons:
- zlib1g-dev

before_script:
# Unfortunately using all threads crashes g++: "g++: internal compiler error: Killed (program cc1plus)"
# Use half of the available threads, gcc is memory hungry
- 'if [ ${CC} = "gcc" ]; then
export THREADS=$((`nproc` / 2));
else
export THREADS=$((`nproc` + 1));
fi'
- echo "THREADS = $THREADS"
- free -mt
- if [[ "$TRAVIS_OS_NAME" == "osx" ]]; then brew update && brew bundle; fi
- if [[ "$TRAVIS_OS_NAME" == "osx" ]]; then sudo mkdir -p /usr/local/include/; fi
- if [[ "$TRAVIS_OS_NAME" == "osx" ]]; then sudo ln -s /System/Library/Frameworks/OpenGL.framework/Versions/A/Headers/ /usr/local/include/GL; fi
- if [[ "$TRAVIS_OS_NAME" == "osx" ]]; then export CMAKE_PREFIX_PATH=/usr/local/opt/freetype/:/usr/local/opt/curl/:/usr/local/opt/libogg/:/usr/local/opt/libogg/:/usr/local/opt/libvorbis/:/usr/local/opt/openssl\@1.1/:/usr/local/opt/glew/:/usr/local/opt/fribidi/; fi

script:
- mkdir "build"
- cd "build"
- cmake .. -DCMAKE_BUILD_TYPE=$BUILD_TYPE -DSERVER_ONLY=$SERVER_ONLY -DCHECK_ASSETS=off -DBUILD_RECORDER=off
- make VERBOSE=1 -j $THREADS
- if [[ "$TRAVIS_OS_NAME" == "osx" ]]; then /usr/local/opt/cmake/bin/cmake .. -DFREETYPE_INCLUDE_DIRS=/usr/local/opt/freetype/include/freetype2/ -DUSE_SYSTEM_GLEW=1 -DOPENAL_INCLUDE_DIR=/usr/local/opt/openal-soft/include/ -DOPENAL_LIBRARY=/usr/local/opt/openal-soft/lib/libopenal.dylib -DFREETYPE_LIBRARY=/usr/local/opt/freetype/lib/libfreetype.dylib -DCMAKE_BUILD_TYPE=$BUILD_TYPE -DSERVER_ONLY=$SERVER_ONLY -DCHECK_ASSETS=off -DBUILD_RECORDER=off; fi
- if [[ "$TRAVIS_OS_NAME" != "osx" ]]; then cmake .. -DCMAKE_BUILD_TYPE=$BUILD_TYPE -DSERVER_ONLY=$SERVER_ONLY -DCHECK_ASSETS=off -DBUILD_RECORDER=off; fi
- make VERBOSE=1 -j3

notifications:
irc:
Expand Down
8 changes: 8 additions & 0 deletions Brewfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
brew "libogg"
brew "libvorbis"
brew "openal-soft"
brew "freetype"
brew "curl"
brew "openssl@1.1"
brew "fribidi"
brew "glew"
8 changes: 1 addition & 7 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -125,7 +125,7 @@ endif()

if(SERVER_ONLY)
add_definitions(-DSERVER_ONLY)
add_definitions(-DNO_IRR_COMPILE_WITH_X11_)
add_definitions(-DNO_IRR_COMPILE_WITH_X11_ -DNO_IRR_COMPILE_WITH_OPENGL_ -DNO_IRR_COMPILE_WITH_OSX_DEVICE_)
endif()

#if(DISABLE_VPX)
Expand Down Expand Up @@ -405,16 +405,10 @@ if(APPLE)
add_executable(supertuxkart MACOSX_BUNDLE ${STK_SOURCES})

find_library(IOKIT_LIBRARY IOKit)
find_library(QUICKTIME_LIBRARY QuickTime)
find_library(CARBON_LIBRARY Carbon)
find_library(AUDIOUNIT_LIBRARY AudioUnit)
find_library(COCOA_LIBRARY Cocoa)

target_link_libraries(supertuxkart
${IOKIT_LIBRARY}
${QUICKTIME_LIBRARY}
${CARBON_LIBRARY}
${AUDIOUNIT_LIBRARY}
${COCOA_LIBRARY})

# configure CMake to use a custom Info.plist
Expand Down
5 changes: 5 additions & 0 deletions lib/irrlicht/include/IrrCompileConfig.h
Original file line number Diff line number Diff line change
Expand Up @@ -91,6 +91,11 @@
#endif
#endif

// Disable macOS/OSX device
#ifdef NO_IRR_COMPILE_WITH_OSX_DEVICE_
#undef _IRR_COMPILE_WITH_OSX_DEVICE_
#endif

#if defined(ANDROID)
#define _IRR_ANDROID_PLATFORM_
#define _IRR_POSIX_API_
Expand Down