Skip to content

Commit

Permalink
Fix library output directory for MSVC
Browse files Browse the repository at this point in the history
  • Loading branch information
zcbenz committed Dec 10, 2024
1 parent 87d7a25 commit 6df0b11
Showing 1 changed file with 13 additions and 2 deletions.
15 changes: 13 additions & 2 deletions python/src/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -29,8 +29,19 @@ if(NOT MLX_PYTHON_BINDINGS_OUTPUT_DIRECTORY)
set(MLX_PYTHON_BINDINGS_OUTPUT_DIRECTORY ${CMAKE_LIBRARY_OUTPUT_DIRECTORY})
endif()

set_target_properties(core PROPERTIES LIBRARY_OUTPUT_DIRECTORY
${MLX_PYTHON_BINDINGS_OUTPUT_DIRECTORY})
set_target_properties(
core
PROPERTIES LIBRARY_OUTPUT_DIRECTORY ${MLX_PYTHON_BINDINGS_OUTPUT_DIRECTORY}
# Do not append a sub-dir for multi-config generators like MSVC
# and XCode.
LIBRARY_OUTPUT_DIRECTORY_RELEASE
${MLX_PYTHON_BINDINGS_OUTPUT_DIRECTORY}
LIBRARY_OUTPUT_DIRECTORY_DEBUG
${MLX_PYTHON_BINDINGS_OUTPUT_DIRECTORY}
LIBRARY_OUTPUT_DIRECTORY_RELWITHDEBINFO
${MLX_PYTHON_BINDINGS_OUTPUT_DIRECTORY}
LIBRARY_OUTPUT_DIRECTORY_MINSIZEREL
${MLX_PYTHON_BINDINGS_OUTPUT_DIRECTORY})

target_link_libraries(core PRIVATE mlx)
target_compile_definitions(core PRIVATE _VERSION_=${MLX_VERSION})
Expand Down

0 comments on commit 6df0b11

Please sign in to comment.