Skip to content

Configuring fails with CMake >=4.0 due to policy changes #243

@TartanLlama

Description

@TartanLlama

CMake 4.0 removes compatibility for CMake versions below 3.5. The version of WASI SDK that StarlingMonkey depends on erroneously declares a cmake_minimum_required of 3.4 in its toolchain file, which as far as I can tell is not affected by the CMAKE_POLICY_VERSION_MINIMUM escape hatch. As such, configuring StarlingMonkey with CMake 4.0 results in the following:

CMake Error at /home/tartanllama/.vs/StarlingMonkey/deps/cpm_cache/wasi-sdk/eb15b745329e65e3454079782694377bbd7768bb/wasi-sdk/share/cmake/wasi-sdk.cmake:4 (cmake_minimum_required):
Compatibility with CMake < 3.5 has been removed from CMake.

Update the VERSION argument <min> value.  Or, use the <min>...<max> syntax
to tell CMake that the project requires at least <min> but has been updated
to work with policies introduced by <max> or earlier.

Or, add -DCMAKE_POLICY_VERSION_MINIMUM=3.5 to try configuring anyway.

This was fixed in WebAssembly/wasi-sdk#412, so merging #189 would fix the issue. In the mean time, as a work around, it suffices to manually edit those lines after CPM pulls in WASI-SDK, or automate this process in cmake/wasi-sdk.cmake

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions