fix OSX build
This commit is contained in:
parent
5bd7e6bfe8
commit
f07070f7f9
|
@ -5,8 +5,17 @@ mkdir build || exit 1
|
||||||
cd build || exit 1
|
cd build || exit 1
|
||||||
# some environments have cmake v2 as 'cmake' and v3 as 'cmake3'
|
# some environments have cmake v2 as 'cmake' and v3 as 'cmake3'
|
||||||
# check for cmake3 first then fallback to just cmake
|
# check for cmake3 first then fallback to just cmake
|
||||||
CMAKE=`which cmake3 2>/dev/null`
|
B_CMAKE=`which cmake3 2>/dev/null`
|
||||||
[ $? -ne 0 -o "x$CMAKE" = "x" ] && CMAKE=cmake
|
[ $? -ne 0 -o "x$B_CMAKE" = "x" ] && B_CMAKE=cmake
|
||||||
$CMAKE -D CMAKE_BUILD_TYPE=Debug .. || exit 1
|
# default build configuration
|
||||||
|
B_BUILD_TYPE=${B_BUILD_TYPE:-Debug}
|
||||||
|
if [ "$(uname)" = "Darwin" ]; then
|
||||||
|
# OSX needs a lot of extra help, poor thing
|
||||||
|
# run the osx_environment.sh script to fix paths
|
||||||
|
[ -r ../osx_environment.sh ] && source ../osx_environment.sh
|
||||||
|
B_CMAKE_FLAGS="-DCMAKE_OSX_SYSROOT=/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.13.sdk $B_CMAKE_FLAGS"
|
||||||
|
fi
|
||||||
|
B_CMAKE_FLAGS="-DCMAKE_BUILD_TYPE=$B_BUILD_TYPE $B_CMAKE_FLAGS"
|
||||||
|
$B_CMAKE $B_CMAKE_FLAGS .. || exit 1
|
||||||
make || exit 1
|
make || exit 1
|
||||||
echo "Build completed successfully"
|
echo "Build completed successfully"
|
||||||
|
|
|
@ -0,0 +1,17 @@
|
||||||
|
#!/bin/sh
|
||||||
|
|
||||||
|
if [ ! $BARRIER_BUILD_ENV ]; then
|
||||||
|
|
||||||
|
printf "Modifying environment for Barrier build..."
|
||||||
|
|
||||||
|
QT_PATH=$(brew --prefix qt)
|
||||||
|
OPENSSL_PATH=$(brew --prefix openssl)
|
||||||
|
|
||||||
|
export CMAKE_PREFIX_PATH="$QT_PATH:$CMAKE_PREFIX_PATH"
|
||||||
|
export LD_LIBRARY_PATH="$OPENSSL_PATH/lib:$LD_LIBRARY_PATH"
|
||||||
|
export CPATH="$OPENSSL_PATH/include:$CPATH"
|
||||||
|
export PKG_CONFIG_PATH="$OPENSSL_PATH/lib/pkgconfig:$PKG_CONFIG_PATH"
|
||||||
|
export BARRIER_BUILD_ENV=1
|
||||||
|
|
||||||
|
printf "done\n"
|
||||||
|
fi
|
|
@ -33,6 +33,9 @@ if (WIN32)
|
||||||
PATH_SUFFIXES "Lib/x64")
|
PATH_SUFFIXES "Lib/x64")
|
||||||
set_target_properties (barrier PROPERTIES LINK_FLAGS "/NODEFAULTLIB:LIBCMT")
|
set_target_properties (barrier PROPERTIES LINK_FLAGS "/NODEFAULTLIB:LIBCMT")
|
||||||
target_link_libraries (barrier ${DNSSD_LIB})
|
target_link_libraries (barrier ${DNSSD_LIB})
|
||||||
|
elseif (APPLE)
|
||||||
|
find_library(APPSERVICES_LIB ApplicationServices)
|
||||||
|
target_link_libraries(barrier ${APPSERVICES_LIB})
|
||||||
elseif (${CMAKE_SYSTEM_NAME} MATCHES "Linux")
|
elseif (${CMAKE_SYSTEM_NAME} MATCHES "Linux")
|
||||||
target_link_libraries (barrier dns_sd)
|
target_link_libraries (barrier dns_sd)
|
||||||
else()
|
else()
|
||||||
|
|
Loading…
Reference in New Issue