Skip to content

Commit

Permalink
Fix OSX compile and deploy
Browse files Browse the repository at this point in the history
Set additional compile flag
Fix FindLdap.cmake for OSX
Use older OSX image on travis (didn't get deploy to work on newer xcode, yet)
Fix DMG creation (sometimes fails if no volume size is provided)
  • Loading branch information
romibi committed Sep 1, 2017
1 parent 1ff488d commit 2b0f63a
Show file tree
Hide file tree
Showing 4 changed files with 15 additions and 11 deletions.
17 changes: 8 additions & 9 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
os:
- linux
- osx

sudo: required
dist: trusty
Expand All @@ -17,13 +16,14 @@ env:
- QT_VERSION=qt5

matrix:
include:
- os: osx
compiler: gcc
env: QT_VERSION=qt5
osx_image: xcode6.4
exclude:
- compiler: clang
env: QT_VERSION=qt4
- os: osx
compiler: clang
- os: osx
env: QT_VERSION=qt4

install: |-
if [ "$TRAVIS_OS_NAME" == "linux" ]
Expand All @@ -50,13 +50,12 @@ script: |-
make
elif [ "$TRAVIS_OS_NAME" == "osx" ]
then
PATH=$PATH:/usr/local/opt/qt5/bin
if [[ "$TRAVIS_TAG" != "" && "$GH_TOKEN" != "" ]]
then
PATH=$PATH:/usr/local/opt/qt5/bin
# The LDAP headers found in OSX Frameworks seem to be broken
cmake -G"Ninja" .. -DCMAKE_BUILD_TYPE=Release -DDEPLOY=ON -DCMAKE_PREFIX_PATH=/usr/local/opt/qt5 -DLDAP_INCLUDE_DIR=/usr/include/
cmake -G"Ninja" .. -DCMAKE_BUILD_TYPE=Release -DDEPLOY=ON
else
cmake -G"Ninja" .. -DCMAKE_BUILD_TYPE=Release -DCMAKE_PREFIX_PATH=/usr/local/opt/qt5 -DLDAP_INCLUDE_DIR=/usr/include/
cmake -G"Ninja" .. -DCMAKE_BUILD_TYPE=Release
fi
ninja install
fi
Expand Down
4 changes: 4 additions & 0 deletions cmake/FindLdap.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,10 @@ endif(LDAP_INCLUDE_DIR AND LDAP_LIBRARIES)

# Attempt to link against ldap.h regardless of platform!
FIND_PATH(LDAP_INCLUDE_DIR ldap.h)
# On osx replace invalid ldap.h
if("${LDAP_INCLUDE_DIR}" STREQUAL "/System/Library/Frameworks/LDAP.framework/Headers")
set(LDAP_INCLUDE_DIR "/usr/include/")
endif()
FIND_LIBRARY(LDAP_LIBRARIES NAMES ldap)
FIND_LIBRARY(LBER_LIBRARIES NAMES lber)

Expand Down
2 changes: 1 addition & 1 deletion cmake/QuasselCompileSettings.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -80,6 +80,6 @@ endif()
# Mac build stuff
if (APPLE AND DEPLOY)
set(CMAKE_OSX_ARCHITECTURES "x86_64")
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -mmacosx-version-min=10.9")
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -mmacosx-version-min=10.9 -stdlib=libc++")
set(CMAKE_OSX_SYSROOT "/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.9.sdk")
endif()
3 changes: 2 additions & 1 deletion scripts/build/macosx_makePackage.sh
Original file line number Diff line number Diff line change
Expand Up @@ -80,5 +80,6 @@ case $BUILDTYPE in
exit 1
;;
esac
hdiutil create -srcfolder ${PACKAGETMPDIR} -format UDBZ -volname "Quassel ${BUILDTYPE} - ${QUASSEL_VERSION}" "${WORKINGDIR}${QUASSEL_DMG}" >/dev/null
PACKAGESIZE=$(echo "$(du -ms ${PACKAGETMPDIR} | cut -f1) * 1.05" | bc)
hdiutil create -srcfolder ${PACKAGETMPDIR} -format UDBZ -size ${PACKAGESIZE}M -volname "Quassel ${BUILDTYPE} - ${QUASSEL_VERSION}" "${WORKINGDIR}${QUASSEL_DMG}" >/dev/null
rm -rf ${PACKAGETMPDIR}

0 comments on commit 2b0f63a

Please sign in to comment.