Skip to content
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

ShellScriptlets.py: assert debuginfo package presence with cmake or m… #307

Merged
merged 1 commit into from
Dec 19, 2024
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
24 changes: 19 additions & 5 deletions HaikuPorter/ShellScriptlets.py
Original file line number Diff line number Diff line change
Expand Up @@ -322,11 +322,19 @@ def getShellVariableSetters(shellVariables):
# helper function to validate CMake invocations (and use the correct one)
cmake()
{
if [[ "$*" != *CMAKE_BUILD_TYPE* ]] && [[ "$*" != *--build* ]] \
&& [[ "$*" != *--install* ]]; then
echo "error: invoking cmake without CMAKE_BUILD_TYPE specified!"
echo "note: you probably want -DCMAKE_BUILD_TYPE=Release or -DCMAKE_BUILD_TYPE=RelWithDebInfo"
exit 1
if [[ "$*" != *--install* ]] && [[ "$*" != *--build* ]]; then
if [[ "$*" != *CMAKE_BUILD_TYPE* ]]; then
echo "error: invoking cmake without CMAKE_BUILD_TYPE specified!"
echo "note: you probably want -DCMAKE_BUILD_TYPE=Release or -DCMAKE_BUILD_TYPE=RelWithDebInfo"
exit 1
elif [[ "$*" = *CMAKE_BUILD_TYPE=Release* ]] && [ -n "$DEBUG_INFO_PACKAGES" ]; then
echo "error: invoking cmake with -DCMAKE_BUILD_TYPE=Release with debug info packages specified"
exit 1
elif [[ "$*" = *CMAKE_BUILD_TYPE=RelWithDebInfo* ]] && [ -z "$DEBUG_INFO_PACKAGES" ]; then
echo -n "error: invoking cmake with -DCMAKE_BUILD_TYPE=RelWithDebInfo without debug info "
echo "packages specified"
exit 1
fi
fi

CMAKE=$portPackageLinksDir/cmd~cmake/bin/cmake
Expand All @@ -344,6 +352,12 @@ def getShellVariableSetters(shellVariables):
echo "error: invoking meson without --buildtype argument"
echo "note: you probably want --buildtype=release or --buildtype=debugoptimized"
exit 1
elif [[ "$*" = *buildtype=release* ]] && [ -n $DEBUG_INFO_PACKAGES ]; then
echo "error: invoking meson with --buildtype=release with debug info packages specified"
exit 1
elif [[ "$*" = *buildtype=debugoptimized* ]] && [ -z $DEBUG_INFO_PACKAGES ]; then
echo "error: invoking meson with --buildtype=debugoptimized without debug info packages specified"
exit 1
fi

MESON=$portPackageLinksDir/cmd~meson/bin/meson
Expand Down
Loading