Skip to content

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

Merged
davidkoski merged 1 commit into
ml-explore:mainfrom
Nicolas-nwb:fix/exclude-cmake-build-artifacts
Sep 28, 2026
Merged

davidkoski merged 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.

@davidkoski
davidkoski force-pushed the fix/exclude-cmake-build-artifacts branch from 7851eb3 to d7b087c Compare August 17, 2026 21:44

@davidkoski davidkoski left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Change looks good, just waiting on CI

@davidkoski
davidkoski merged commit 2b5e877 into ml-explore:main Sep 28, 2026
7 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