-
Notifications
You must be signed in to change notification settings - Fork 35
Install debug libraries on Windows #1219
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
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -89,6 +89,8 @@ set(UMF_INSTALL_RPATH | |
"Set the runtime search path to the directory with dependencies (e.g. hwloc)" | ||
) | ||
|
||
umf_option(UMF_USE_DEBUG_POSTFIX "Add a 'd' postfix to Windows debug libraries" | ||
OFF) | ||
umf_option(UMF_DEVELOPER_MODE "Enable additional developer checks" OFF) | ||
umf_option( | ||
UMF_FORMAT_CODE_STYLE | ||
|
@@ -426,6 +428,27 @@ elseif(UMF_BUILD_CUDA_PROVIDER) | |
message(STATUS "CUDA_INCLUDE_DIRS = ${CUDA_INCLUDE_DIRS}") | ||
endif() | ||
|
||
if(WINDOWS AND UMF_USE_DEBUG_POSTFIX) | ||
# Build debug umf library with the d suffix that is compiled with /MDd so | ||
# users can link against it in debug builds. | ||
set(CMAKE_DEBUG_POSTFIX d) | ||
|
||
add_custom_target( | ||
umfd ALL | ||
COMMAND ${CMAKE_COMMAND} --build ${CMAKE_BINARY_DIR} --target umf | ||
--config Debug | ||
COMMENT "Building debug umf library with the d suffix") | ||
|
||
# Copy built UMF libraries to the Release build subdirectory | ||
add_custom_command( | ||
TARGET umfd | ||
COMMAND ${CMAKE_COMMAND} -E copy ${CMAKE_BINARY_DIR}/bin/Debug/umfd.dll | ||
${CMAKE_BINARY_DIR}/bin/Release/umfd.dll | ||
COMMAND ${CMAKE_COMMAND} -E copy ${CMAKE_BINARY_DIR}/lib/Debug/umfd.lib | ||
${CMAKE_BINARY_DIR}/lib/Release/umfd.lib | ||
COMMENT "Copying debug libraries to the Release build directory") | ||
Comment on lines
+443
to
+449
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This breaks when using Ninja generator (I assume also Unix Makefiles which is what internal builds use). There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Changes made in #1238 |
||
endif() | ||
|
||
# This build type check is not possible on Windows when CMAKE_BUILD_TYPE is not | ||
# set, because in this case the build type is determined after a CMake | ||
# configuration is done (at the build time) | ||
|
@@ -818,6 +841,14 @@ endif() | |
# --------------------------------------------------------------------------- # | ||
# Configure make install/uninstall and packages | ||
# --------------------------------------------------------------------------- # | ||
# Install umfd target | ||
if(WINDOWS AND UMF_USE_DEBUG_POSTFIX) | ||
install(FILES ${CMAKE_BINARY_DIR}/bin/Debug/umfd.dll | ||
DESTINATION ${CMAKE_INSTALL_BINDIR}) | ||
install(FILES ${CMAKE_BINARY_DIR}/lib/Debug/umfd.lib | ||
DESTINATION ${CMAKE_INSTALL_LIBDIR}) | ||
Comment on lines
+846
to
+849
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. And so do these. Also unable to install only these because there's no |
||
endif() | ||
|
||
install(FILES ${PROJECT_SOURCE_DIR}/LICENSE.TXT | ||
DESTINATION "${CMAKE_INSTALL_DATAROOTDIR}/doc/${PROJECT_NAME}/") | ||
install( | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
could you also add comment here?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done