Skip to content
Closed
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
8 changes: 7 additions & 1 deletion pkgs/development/tools/build-managers/cmake/setup-hook.sh
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,13 @@ cmakeConfigurePhase() {

# Avoid cmake resetting the rpath of binaries, on make install
# And build always Release, to ensure optimisation flags
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The comment is now off

cmakeFlags="-DCMAKE_BUILD_TYPE=Release -DCMAKE_SKIP_BUILD_RPATH=ON $cmakeFlags"
cmakeFlags="-DCMAKE_SKIP_BUILD_RPATH=ON $cmakeFlags"

if [ -n "$cmakeBuildType" ]; then
cmakeFlags="-DCMAKE_BUILD_TYPE=$cmakeBuildType $cmakeFlags"
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If one appends -DCMAKE_BUILD_TYPE=Debug to cmakeFlags, does that not override the setting made here? In which case, we need only the dontAddBuildType option.

elif [ -z "dontAddBuildType" ]; then
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This should read "$dontAddBuildType, it's missing the $.

A little bikeshedding here: could we call this cmakeDontSetBuildType instead? The cmake prefix matches the other CMake-specific variables. I'm less particular on Set instead of Add, but it sounds like a better verb to me.

cmakeFlags="-DCMAKE_BUILD_TYPE=Release $cmakeFlags"
fi

echo "cmake flags: $cmakeFlags ${cmakeFlagsArray[@]}"

Expand Down