Skip to content

Revert CMake pin (#375) and properly fix HEADERS file set on FRAMEWORK target #376

Description

@kraenhansen

Context

CMake 4.2.x (the current default on GitHub's macos-latest runners) rejects our weak-node-api build with:

CMake Error in CMakeLists.txt:
  The file set "HEADERS", of type "HEADERS", is incompatible with the
  "FRAMEWORK" target "weak-node-api".

As a temporary unblock, #375 (and the unit-tests pin in #374) pins CMake to 4.1.2 on macOS CI, which still tolerates this configuration. That's a workaround, not a fix — it freezes our macOS CI on an old CMake and will break again when 4.1.2 becomes unavailable or when contributors run a newer local CMake.

Root cause

packages/weak-node-api/CMakeLists.txt attaches headers to the same target two ways:

  • Modern FILE_SET HEADERS — lines 16-24
  • Legacy framework PUBLIC_HEADER — line 38, inside the if(APPLE) block that also sets FRAMEWORK TRUE (line 32)

CMake 4.2 made a HEADERS file set incompatible with a FRAMEWORK target, so setting both on the Apple build is now an error.

Proper fix

Ensure we don't declare a HEADERS file set while building a framework. Options to explore:

  • On Apple (FRAMEWORK TRUE), rely solely on PUBLIC_HEADER and avoid the FILE_SET HEADERS; on other platforms keep FILE_SET HEADERS.
  • Or drop PUBLIC_HEADER and use the file set's own framework/install integration if it covers our XCFramework packaging needs.

Whichever path, verify the produced macOS .framework still contains the expected public headers and the XCFramework packaging is unchanged.

Acceptance criteria

References

Metadata

Metadata

Assignees

Labels

Apple 🍎Anything related to the Apple platform (iOS, macOS, Cocoapods, Xcode, XCFrameworks, etc.)CIContinuous integration

Type

No type

Fields

No fields configured for issues without a type.

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions