[dstorage] Fix port bug with RelWithDebInfo remap#37485
[dstorage] Fix port bug with RelWithDebInfo remap#37485walbourn wants to merge 4 commits intomicrosoft:masterfrom
Conversation
Actually this doesn't need a change to the code but to that variable: Cf. Note that vcpkg already initializes the variable. vcpkg/scripts/buildsystems/vcpkg.cmake Lines 226 to 231 in d64c5e8 |
| set_target_properties(Microsoft::DirectStorage PROPERTIES | ||
| IMPORTED_LOCATION "${_dstorage_root}/bin/dstorage.dll" | ||
| IMPORTED_IMPLIB "${_dstorage_root}/lib/@lib_name@" | ||
| INTERFACE_INCLUDE_DIRECTORIES "${_dstorage_root}/include" | ||
| INTERFACE_LINK_LIBRARIES "Microsoft::DirectStorageCore" | ||
| MAP_IMPORTED_CONFIG_MINSIZEREL "" | ||
| MAP_IMPORTED_CONFIG_RELWITHDEBINFO "" | ||
| IMPORTED_LINK_INTERFACE_LANGUAGES "C") | ||
|
|
||
| add_library(Microsoft::DirectStorageCore SHARED IMPORTED) | ||
| set_target_properties(Microsoft::DirectStorageCore PROPERTIES | ||
| IMPORTED_LOCATION "${_dstorage_root}/bin/dstoragecore.dll" | ||
| IMPORTED_IMPLIB "${_dstorage_root}/lib/@lib_name@" | ||
| INTERFACE_INCLUDE_DIRECTORIES "${_dstorage_root}/include" | ||
| MAP_IMPORTED_CONFIG_MINSIZEREL "" | ||
| MAP_IMPORTED_CONFIG_RELWITHDEBINFO "" | ||
| IMPORTED_LINK_INTERFACE_LANGUAGES "C") |
There was a problem hiding this comment.
Can you try if this will work?
| set_target_properties(Microsoft::DirectStorage PROPERTIES | |
| IMPORTED_LOCATION "${_dstorage_root}/bin/dstorage.dll" | |
| IMPORTED_IMPLIB "${_dstorage_root}/lib/@lib_name@" | |
| INTERFACE_INCLUDE_DIRECTORIES "${_dstorage_root}/include" | |
| INTERFACE_LINK_LIBRARIES "Microsoft::DirectStorageCore" | |
| MAP_IMPORTED_CONFIG_MINSIZEREL "" | |
| MAP_IMPORTED_CONFIG_RELWITHDEBINFO "" | |
| IMPORTED_LINK_INTERFACE_LANGUAGES "C") | |
| add_library(Microsoft::DirectStorageCore SHARED IMPORTED) | |
| set_target_properties(Microsoft::DirectStorageCore PROPERTIES | |
| IMPORTED_LOCATION "${_dstorage_root}/bin/dstoragecore.dll" | |
| IMPORTED_IMPLIB "${_dstorage_root}/lib/@lib_name@" | |
| INTERFACE_INCLUDE_DIRECTORIES "${_dstorage_root}/include" | |
| MAP_IMPORTED_CONFIG_MINSIZEREL "" | |
| MAP_IMPORTED_CONFIG_RELWITHDEBINFO "" | |
| IMPORTED_LINK_INTERFACE_LANGUAGES "C") | |
| set_target_properties(Microsoft::DirectStorage PROPERTIES | |
| IMPORTED_CONFIGURATIONS "RELEASE" | |
| IMPORTED_LOCATION_RELEASE "${_dstorage_root}/bin/dstorage.dll" | |
| IMPORTED_IMPLIB_RELEASE "${_dstorage_root}/lib/@lib_name@" | |
| INTERFACE_INCLUDE_DIRECTORIES "${_dstorage_root}/include" | |
| INTERFACE_LINK_LIBRARIES "Microsoft::DirectStorageCore" | |
| IMPORTED_LINK_INTERFACE_LANGUAGES "C") | |
| add_library(Microsoft::DirectStorageCore SHARED IMPORTED) | |
| set_target_properties(Microsoft::DirectStorageCore PROPERTIES | |
| IMPORTED_CONFIGURATIONS "RELEASE" | |
| IMPORTED_LOCATION_RELEASE "${_dstorage_root}/bin/dstoragecore.dll" | |
| IMPORTED_IMPLIB_RELEASE "${_dstorage_root}/lib/@lib_name@" | |
| INTERFACE_INCLUDE_DIRECTORIES "${_dstorage_root}/include" | |
| IMPORTED_LINK_INTERFACE_LANGUAGES "C") |
There was a problem hiding this comment.
This works but ONLY if you have set(CMAKE_MAP_IMPORTED_CONFIG_RELWITHDEBINFO "Release")
The 'correct' solution for CMake's perspective seems to me to be (a) use the non-config specific versions of the library, but be sure to set all the remap properties to empty.
|
|
||
| if(NOT DEFINED VCPKG_BUILD_TYPE) | ||
| file(MAKE_DIRECTORY "${CURRENT_PACKAGES_DIR}/debug") | ||
| file(INSTALL "${CURRENT_PACKAGES_DIR}/bin" "${CURRENT_PACKAGES_DIR}/lib" DESTINATION "${CURRENT_PACKAGES_DIR}/debug") | ||
| endif() |
There was a problem hiding this comment.
If my suggestion above works, can you try removing this?
But this change was only made VERY recently I see... |
The only thing that is new there is |
|
Looks like none of this is actually needed thanks to #35940 removing the need for my CMakeLists to use |
While working on #37401 I realized this port would not work correctly if I use
set(CMAKE_MAP_IMPORTED_CONFIG_RELWITHDEBINFO Release)which is required for my other ports to work with RelWithDebInfo.Also includes some cleanup for the port as well as respecting
VCPKG_BUILD_TYPE=release.