From 24ec5978c87fa3599e2e67303a0f2873dd29308e Mon Sep 17 00:00:00 2001 From: daanx Date: Fri, 10 Jan 2025 10:59:44 -0800 Subject: [PATCH 1/2] use .dll.pdb for the dll debug file in Visual Studio --- ide/vs2022/mimalloc-override-dll.vcxproj | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/ide/vs2022/mimalloc-override-dll.vcxproj b/ide/vs2022/mimalloc-override-dll.vcxproj index f613f6df..d80d0b02 100644 --- a/ide/vs2022/mimalloc-override-dll.vcxproj +++ b/ide/vs2022/mimalloc-override-dll.vcxproj @@ -181,6 +181,7 @@ Default false $(OutDir)$(TargetName).dll.lib + $(OutDir)$(TargetName).dll.pdb COPY /Y "$(ProjectDir)..\..\bin\mimalloc-redirect32.dll" "$(OutputPath)" @@ -210,6 +211,7 @@ Default false $(OutDir)$(TargetName).dll.lib + $(OutDir)$(TargetName).dll.pdb COPY /Y "$(ProjectDir)..\..\bin\mimalloc-redirect.dll" "$(OutputPath)" @@ -239,6 +241,7 @@ Default false $(OutDir)$(TargetName).dll.lib + $(OutDir)$(TargetName).dll.pdb COPY /Y "$(ProjectDir)..\..\bin\mimalloc-redirect-arm64.dll" "$(OutputPath)" @@ -268,6 +271,7 @@ Default false $(OutDir)$(TargetName).dll.lib + $(OutDir)$(TargetName).dll.pdb COPY /Y "$(ProjectDir)..\..\bin\mimalloc-redirect-arm64ec.dll" "$(OutputPath)" @@ -301,6 +305,7 @@ Default false $(OutDir)$(TargetName).dll.lib + $(OutDir)$(TargetName).dll.pdb COPY /Y "$(ProjectDir)..\..\bin\mimalloc-redirect32.dll" "$(OutputPath)" @@ -334,6 +339,7 @@ Default false $(OutDir)$(TargetName).dll.lib + $(OutDir)$(TargetName).dll.pdb COPY /Y "$(ProjectDir)..\..\bin\mimalloc-redirect.dll" "$(OutputPath)" @@ -368,6 +374,7 @@ Default false $(OutDir)$(TargetName).dll.lib + $(OutDir)$(TargetName).dll.pdb COPY /Y "$(ProjectDir)..\..\bin\mimalloc-redirect-arm64.dll" "$(OutputPath)" @@ -402,6 +409,7 @@ Default false $(OutDir)$(TargetName).dll.lib + $(OutDir)$(TargetName).dll.pdb COPY /Y "$(ProjectDir)..\..\bin\mimalloc-redirect-arm64ec.dll" "$(OutputPath)" From 8d520306b8a004d512d870f2d0b2d9868600ea61 Mon Sep 17 00:00:00 2001 From: daanx Date: Sat, 11 Jan 2025 12:32:23 -0800 Subject: [PATCH 2/2] set pdb name on windows --- CMakeLists.txt | 9 ++++++--- contrib/vcpkg/vcpkg.json | 4 ++-- 2 files changed, 8 insertions(+), 5 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 68065741..c766ce3a 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -126,7 +126,7 @@ if(CMAKE_C_COMPILER_ID MATCHES "Intel") endif() # negative overrides (mainly to support vcpkg features) -if(MI_NO_USE_CXX) +if(MI_NO_USE_CXX) set(MI_USE_CXX "OFF") endif() if(MI_NO_OPT_ARCH) @@ -568,10 +568,13 @@ if(MI_BUILD_SHARED) install(EXPORT mimalloc DESTINATION ${mi_install_cmakedir}) if(WIN32) - # On windows, the import library name for the dll would clash with the static mimalloc.lib - # so we postfix the dll import library with `.dll.lib`. + # On windows, the import library name for the dll would clash with the static mimalloc.lib library + # so we postfix the dll import library with `.dll.lib` (and also the .pdb debug file) set_property(TARGET mimalloc PROPERTY ARCHIVE_OUTPUT_NAME "${mi_libname}.dll" ) install(FILES "$/${mi_libname}.dll.lib" DESTINATION ${CMAKE_INSTALL_LIBDIR}) + set_property(TARGET mimalloc PROPERTY PDB_NAME "${mi_libname}.dll") + # don't try to install the pdb since it may not be generated depending on the configuration + # install(FILES "$/${mi_libname}.dll.pdb" DESTINATION ${CMAKE_INSTALL_LIBDIR}) endif() if(WIN32 AND MI_WIN_REDIRECT) # On windows, link and copy the mimalloc redirection dll too. diff --git a/contrib/vcpkg/vcpkg.json b/contrib/vcpkg/vcpkg.json index 69a72edf..bdbe9ba1 100644 --- a/contrib/vcpkg/vcpkg.json +++ b/contrib/vcpkg/vcpkg.json @@ -19,7 +19,7 @@ "features": { "c": { "description": "Use C11 compilation (this can still override new/delete)" - }, + }, "override": { "description": "Override the standard malloc/free interface" }, @@ -31,6 +31,6 @@ }, "asm": { "description": "Generate assembly files" - } + } } } \ No newline at end of file