fix: Only add build type to CMAKE_LIBRARY_OUTPUT_DIRECTORY
if needed
#299
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This PR only appends
CMAKE_BUILD_TYPE
toCMAKE_LIBRARY_OUTPUT_DIRECTORY
if the build dir path doesn't already end with the build type.Maintaining parallel build trees for release/debug can reduce rebuild times when switching between configs*.
If a user wishes to configure this way today,
cmake-js
defines a nonsense path forLIBRARY_OUTPUT_DIRECTORY
:I assume this is to align with
node-gyp
andrequire('bindings')('foo.node')
, which this PR would still support.If the user configured into
build/${cmake_build_type}
, theLIBRARY_OUTPUT_DIRECTORY
should be${cmake_binary_dir}
, not${cmake_binary_dir}/{cmake_build_type}
.* An alternative could be to customize the location of the object files based on build type... but this isn't supported by CMake 🙁.