Skip to content

Commit

Permalink
fix windows mimalloc build
Browse files Browse the repository at this point in the history
  • Loading branch information
pablohoch committed Oct 25, 2024
1 parent 5ff561e commit 9968fc9
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,8 @@ if (MSVC)
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /wd4996") # ignore deprecated fileno in tiles
endif ()

option(OSR_MIMALLOC "use mimalloc" OFF)

if (NOT DEFINED CMAKE_MSVC_RUNTIME_LIBRARY)
if (OSR_MIMALLOC)
set(CMAKE_MSVC_RUNTIME_LIBRARY "MultiThreaded$<$<CONFIG:Debug>:Debug>DLL")
Expand All @@ -29,7 +31,6 @@ if (NOT DEFINED CMAKE_MSVC_RUNTIME_LIBRARY)
endif ()
endif ()

option(OSR_MIMALLOC "use mimalloc" OFF)
if (OSR_MIMALLOC AND WIN32)
set(MI_BUILD_SHARED ON)
endif ()
Expand Down Expand Up @@ -155,9 +156,9 @@ if (OSR_MIMALLOC)
add_custom_command(
TARGET osr-extract POST_BUILD
COMMAND "${CMAKE_COMMAND}" -E copy
"${CMAKE_CURRENT_BINARY_DIR}/deps/mimalloc/mimalloc-redirect.dll"
"${CMAKE_BINARY_DIR}/deps/mimalloc/mimalloc-redirect.dll"
$<TARGET_FILE_DIR:osr>
COMMENT "Copy mimalloc-redirect.dll to output directory"
)
endif ()
endif ()
endif ()

0 comments on commit 9968fc9

Please sign in to comment.