8000 Allow using ninja on default if ninja is found on Linux platform by VitalyAnkh · Pull Request #172 · BoomingTech/Piccolo · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

Allow using ninja on default if ninja is found on Linux platform #172

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

Merged
merged 2 commits into from
May 7, 2022
Merged
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
30 changes: 23 additions & 7 deletions build_linux.sh
Original file line number Diff line number Diff line change
@@ -1,16 +1,34 @@
#!/bin/bash

if test \( $# -ne 1 \);
if test \( $# -gt 2 \);
then
echo "Usage: build.sh arch config"
echo "Usage: ./build_linux.sh config [build-tool]"
echo ""
echo "Configs:"
echo "config:"
echo " debug - build with the debug configuration"
echo " release - build with the release configuration"
echo ""
echo "build-tool:"
echo " make - build with Unix Make"
echo " ninja - build with Ninja"
echo ""
exit 1
fi

if test \( $# -eq 1 \) ;then
if command -v ninja &> /dev/null; then
CMAKE_ARG_BUILD_TOOL_TYPE_CONFIG="-G Ninja"
else
CMAKE_ARG_BUILD_TOOL_TYPE_CONFIG="-G Unix Makefiles"
fi
elif test \( \( -n "$2" \) -a \( "$2" = "makefile" \) \);then
CMAKE_ARG_BUILD_TOOL_TYPE_CONFIG="-G Unix Makefiles"
elif test \( \( -n "$2" \) -a \( "$2" = "ninja" \) \);then
CMAKE_ARG_BUILD_TOOL_TYPE_CONFIG="-G Ninja"
else
echo "The build-tool \"$2\" is not supported!"
exit 1
fi

if test \( \( -n "$1" \) -a \( "$1" = "debug" \) \);then
CMAKE_ARG_BUILD_TYPE_CONFIG="-DCMAKE_BUILD_TYPE=Debug"
Expand All @@ -31,9 +49,7 @@ cd "${MY_DIR}"

mkdir -p "engine/shader/generated/spv"


export CC=clang
export CXX=clang++
cmake -S . -B build "${CMAKE_ARG_BUILD_TYPE_CONFIG}" -DCMAKE_EXPORT_COMPILE_COMMANDS=ON

cmake --build "${MY_DIR}/build" -- -j
cmake -S . -B build "${CMAKE_ARG_BUILD_TYPE_CONFIG}" "${CMAKE_ARG_BUILD_TOOL_TYPE_CONFIG}" -DCMAKE_EXPORT_COMPILE_COMMANDS=ON
cmake --build "${MY_DIR}/build" -- all
0