Skip to content

Enable use of Ninja Multi-Config generator for Linux builds #1017

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 1 commit into from
Apr 17, 2025
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
17 changes: 3 additions & 14 deletions .github/workflows/linux.yml
Original file line number Diff line number Diff line change
Expand Up @@ -58,25 +58,14 @@ jobs:
doc: OFF, jni: ON, loadtests: OpenGL+Vulkan, py: ON, tools: ON, tools_cts: ON,
sse: ON, opencl: OFF
}
- name: Clang Debug
- name: Clang
os: ubuntu-22.04
generator: Ninja
arch: x86_64
compiler: clang
vk_sdk_ver: '1.3.290'
options: {
config: Debug,
doc: OFF, jni: ON, loadtests: OpenGL+Vulkan, py: ON, tools: ON, tools_cts: OFF,
sse: ON, opencl: OFF
}
- name: Clang Release
os: ubuntu-22.04
generator: Ninja
generator: Ninja Multi-Config
arch: x86_64
compiler: clang
vk_sdk_ver: '1.3.290'
options: {
config: Release,
config: 'Debug,Release',
doc: OFF, jni: ON, loadtests: OpenGL+Vulkan, py: ON, tools: ON, tools_cts: OFF,
sse: ON, opencl: OFF
}
Expand Down
26 changes: 20 additions & 6 deletions scripts/build_linux.sh
Original file line number Diff line number Diff line change
Expand Up @@ -54,25 +54,39 @@ if [[ "$ARCH" = "aarch64" && "$FEATURE_LOADTESTS" =~ "Vulkan" ]]; then
else
FEATURE_LOADTESTS=OpenGL
fi
echo "Forcing FEATURE_LOADTESTS to \"$FEATURE_LOADTESTS\" as no Vulkan SDK yet for Linux/arm64."
echo "$0: Forcing FEATURE_LOADTESTS to \"$FEATURE_LOADTESTS\" as no Vulkan SDK yet for Linux/arm64."
fi

if [ ! "$CMAKE_GEN" = "Ninja Multi-Config" ]; then
# Single configuration generator.
if [[ "$CONFIGURATION" =~ "," ]]; then
echo "$0: Multiple build configurations specified with single-configuration CMake generator."
exit 1
fi
fi

cmake_args=("-G" "$CMAKE_GEN")

if [[ -z $BUILD_DIR ]]; then
BUILD_DIR=build/linux
if [ "$ARCH" != $(uname -m) ]; then
BUILD_DIR+="-$ARCH-"
fi
if [ "$CMAKE_GEN" = "Ninja" -o "$CMAKE_GEN" = "Unix Makefiles" ]; then
# Single configuration generators.
if [ ! "$CMAKE_GEN" = "Ninja Multi-Config" ]; then
# Single configuration generator. That only a single configuration
# is specified has already been verified.
BUILD_DIR+="-$CONFIGURATION"
CMAKE_BUILD_TYPE=$CONFIGURATION
fi
fi
cmake_args+=("-B" $BUILD_DIR)
if [ -n "$CMAKE_BUILD_TYPE" ]; then
cmake_args+=("-D" "CMAKE_BUILD_TYPE=$CMAKE_BUILD_TYPE")
fi

mkdir -p $BUILD_DIR

cmake_args=("-G" "$CMAKE_GEN"
"-B" $BUILD_DIR \
"-D" "CMAKE_BUILD_TYPE=$CONFIGURATION" \
cmake_args+=(\
"-D" "KTX_FEATURE_DOC=$FEATURE_DOC" \
"-D" "KTX_FEATURE_JNI=$FEATURE_JNI" \
"-D" "KTX_FEATURE_LOADTEST_APPS=$FEATURE_LOADTESTS" \
Expand Down
Loading