Skip to content

Conversation

@lucianoiam
Copy link
Contributor

Could not find a better method that checks for MinGW in Python. sys.platform is returning win32 even for MinGW in my setup.

Fixes the following error when trying to run cmake

CMake Error at CMakeLists.txt:44 (project):
  Generator

    Ninja

  does not support platform specification, but platform

    x64

  was specified.
@wenyongh
Copy link
Contributor

Could not find a better method that checks for MinGW in Python. sys.platform is returning win32 even for MinGW in my setup.

Hi, maybe you can try platform.uname().system or sysconfig.get_platform(), see:
https://stackoverflow.com/questions/1854/python-what-os-am-i-running-on/1857
And as platform is the argument of function
build_llvm(llvm_dir, platform, backends, projects)
using platform again will cause compilation error, please define a function before to check it,
and then call the function in build_llvm.

Fix linker errors because of missing libraries ssp and Ws2_32
@lucianoiam
Copy link
Contributor Author

platform.uname().system returns Windows on MinGW, however sysconfig.get_platform() did the trick (for example: mingw_x86_64). Since there is no need to import platform a new function is not necessary (unless it is for clarity?)

Force-pushed a new commit, thanks.

@wenyongh wenyongh merged commit c8804c1 into bytecodealliance:main Feb 18, 2022
xujuntwt95329 pushed a commit to xujuntwt95329/wasm-micro-runtime that referenced this pull request Mar 13, 2022
Use sysconfig.get_platform() to check whether the platform is MinGW,
and link necessary libraries to wamrc on MinGW.
vickiegpt pushed a commit to vickiegpt/wamr-aot-gc-checkpoint-restore that referenced this pull request May 27, 2024
Use sysconfig.get_platform() to check whether the platform is MinGW,
and link necessary libraries to wamrc on MinGW.
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