Skip to content

set(CMAKE_SYSTEM_NAME WASI) issues on macOS host #181

@axic

Description

@axic

It is great to have wasi.cmake and we use it in several projects (ethash,evmone), however during integration we have noticed one shortcoming stemming from the set(CMAKE_SYSTEM_NAME WASI) setting.

CMake will try to find Platform/WASI.cmake, but if missing, it will fall back to the host system. This works okay on Linux systems, but fails on macOS as that will add compiler settings only available/valid for macOS targets.

There are two possible fixes I have found:

  1. Copy the platform file to CMake
  2. Change/override the CMAKE_SYSTEM_NAME to Linux

The downside of option 1 is that it requires change to the installed cmake (copying a new file), while using the toolchain file works without any host changes.

We have decided to override the system name in our files, but I wonder if it would make sense to just change it to Linux in this repository. Any opinions? I can submit a PR if that is there's agreement for this change.

If there's any other options on top of the above, please let me know.

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