Skip to content

package: exclude mlx/build cmake artifacts from Cmlx target#402

Open
Nicolas-nwb wants to merge 1 commit into
ml-explore:mainfrom
Nicolas-nwb:fix/exclude-cmake-build-artifacts
Open

package: exclude mlx/build cmake artifacts from Cmlx target#402
Nicolas-nwb wants to merge 1 commit into
ml-explore:mainfrom
Nicolas-nwb:fix/exclude-cmake-build-artifacts

Conversation

@Nicolas-nwb
Copy link
Copy Markdown
Contributor

Problem

Running cmake -B build (standard cmake workflow) creates
mlx/build/_deps/doctest-src/scripts/hello_world.cpp, which contains
main(). SwiftPM scans the full Cmlx source tree and finds this file,
classifying the target as an executable instead of a library:

error: module 'Cmlx' is the main module of an executable

Fix

Add "mlx/build" to the excludedSources list of the Cmlx target.

Impact

One line added to Package.swift. No API change, no behaviour change.
Lets contributors build mlx with cmake -B build alongside a Swift
consumer of the package without errors.

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.

1 participant