Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix library output directory for MSVC #1681

Merged
merged 1 commit into from
Dec 10, 2024
Merged

Conversation

zcbenz
Copy link
Contributor

@zcbenz zcbenz commented Dec 9, 2024

Refs #1513.

For MSVC you have to specify library output dir for every config otherwise the file would be put into out/Debug, out/Release, etc. instead of out directly.

Comment on lines 32 to 46
if(MSVC)
set_target_properties(
core
PROPERTIES 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})
else()
set_target_properties(core PROPERTIES LIBRARY_OUTPUT_DIRECTORY
${MLX_PYTHON_BINDINGS_OUTPUT_DIRECTORY})
endif()
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why not just use the first condition for every platform and discard the check for MSVC?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Updated. It seems that some build systems other than MSVC also require this to work.

Copy link
Member

@awni awni left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you 👍

@awni awni merged commit a59fae0 into ml-explore:main Dec 10, 2024
5 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants