forked from deskflow/deskflow
-
Notifications
You must be signed in to change notification settings - Fork 1.5k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #413 from debauchee/revert-405-fix/build-scripts
Revert "Tidy up and fix lint errors in build scripts"
- Loading branch information
Showing
2 changed files
with
14 additions
and
40 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,52 +1,28 @@ | ||
#!/bin/bash | ||
|
||
set -eu # we set this to catch errors and terminate | ||
|
||
cd "$(dirname "$0")" || exit 1 | ||
|
||
#!/bin/sh | ||
cd "$(dirname $0)" || exit 1 | ||
# some environments have cmake v2 as 'cmake' and v3 as 'cmake3' | ||
# check for cmake3 first then fallback to just cmake | ||
|
||
if type cmake3 2>/dev/null; then | ||
B_CMAKE=$(command -v "$(echo "$B_CMAKE" | cut -d' ' -f3)") | ||
B_CMAKE=`type cmake3 2>/dev/null` | ||
if [ $? -eq 0 ]; then | ||
B_CMAKE=`echo $B_CMAKE | cut -d' ' -f3` | ||
else | ||
B_CMAKE=$(command -v cmake) | ||
B_CMAKE=cmake | ||
fi | ||
|
||
# default build configuration | ||
B_BUILD_TYPE=${B_BUILD_TYPE:-Debug} | ||
|
||
if [ "$(uname -s)" = "Darwin" ]; then | ||
if [ "$(uname)" = "Darwin" ]; then | ||
# OSX needs a lot of extra help, poor thing | ||
# run the osx_environment.sh script to fix paths | ||
if [ -f "./osx_environment.sh" ]; then | ||
. ./osx_environment.sh | ||
fi | ||
. ./osx_environment.sh | ||
B_CMAKE_FLAGS="-DCMAKE_OSX_SYSROOT=$(xcode-select --print-path)/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk -DCMAKE_OSX_DEPLOYMENT_TARGET=10.9 $B_CMAKE_FLAGS" | ||
fi | ||
|
||
# allow local customizations to build environment | ||
if [ -f "./build_env.sh" ]; then | ||
. ./build_env.sh | ||
fi | ||
|
||
set +eu # disable this temporarily | ||
if [ -n "${B_CMAKE_FLAGS}" ]; then | ||
B_CMAKE_FLAGS="-DCMAKE_BUILD_TYPE=$B_BUILD_TYPE ${B_CMAKE_FLAGS}" | ||
else | ||
B_CMAKE_FLAGS="-DCMAKE_BUILD_TYPE=$B_BUILD_TYPE" | ||
fi | ||
set -eu # enable this | ||
|
||
[ -r ./build_env.sh ] && . ./build_env.sh | ||
B_CMAKE_FLAGS="-DCMAKE_BUILD_TYPE=$B_BUILD_TYPE $B_CMAKE_FLAGS" | ||
rm -rf build | ||
mkdir build || exit 1 | ||
cd build || exit 1 | ||
|
||
echo "Starting Barrier build..." | ||
echo "Build type: ${B_BUILD_TYPE}" | ||
|
||
"$B_CMAKE" "$B_CMAKE_FLAGS" .. || exit 1 | ||
|
||
echo Starting Barrier $B_BUILD_TYPE build... | ||
$B_CMAKE $B_CMAKE_FLAGS .. || exit 1 | ||
make || exit 1 | ||
|
||
echo "Build completed successfully." | ||
echo "Build completed successfully" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters