mirror of
https://github.com/ml-explore/mlx.git
synced 2025-08-10 03:06:39 +08:00
Fix library output directory for MSVC (#1681)
This commit is contained in:
parent
29a620cab2
commit
a59fae040f
3
.gitignore
vendored
3
.gitignore
vendored
@ -76,6 +76,9 @@ build/
|
||||
*.out
|
||||
*.app
|
||||
|
||||
# Debug symbols
|
||||
*.pdb
|
||||
|
||||
# VSCode
|
||||
.vscode/
|
||||
.DS_Store
|
||||
|
@ -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})
|
||||
|
3
setup.py
3
setup.py
@ -67,7 +67,8 @@ class CMakeBuild(build_ext):
|
||||
"-DMLX_BUILD_EXAMPLES=OFF",
|
||||
f"-DMLX_PYTHON_BINDINGS_OUTPUT_DIRECTORY={extdir}{os.sep}",
|
||||
]
|
||||
build_args = []
|
||||
# Some generators require explcitly passing config when building.
|
||||
build_args = ["--config", cfg]
|
||||
# Adding CMake arguments set as environment variable
|
||||
# (needed e.g. to build for ARM OSx on conda-forge)
|
||||
if "CMAKE_ARGS" in os.environ:
|
||||
|
Loading…
Reference in New Issue
Block a user