Skip to content

Commit

Permalink
ShellScriptlets.py: assert debuginfo package presence with cmake or m…
Browse files Browse the repository at this point in the history
…eson build type (#307)
  • Loading branch information
korli authored Dec 19, 2024
1 parent a7cef38 commit efe357b
Showing 1 changed file with 19 additions and 5 deletions.
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

0 comments on commit efe357b

Please sign in to comment.