Skip to content

[GDExtension] Cant cross-compile from linux to windows #605

Open

Description

@nonunknown

Screenshot_2021-08-31_18-52-40

As you can see in the image above, from lines 6-15 I've commented them, for some reason, the try to identify platform doesnt pass in the lines 101-117:

elif env["platform"] == "windows":
    print("XWin for linux")
    env["target_path"] += "win64/"
    cpp_library += ".windows"
    # This makes sure to keep the session environment variables on windows,
    # that way you can run scons in a vs 2017 prompt and it will find all the required tools
    env.Append(ENV=os.environ)

    env.Append(CPPDEFINES=["WIN32", "_WIN32", "_WINDOWS", "_CRT_SECURE_NO_WARNINGS"])
    env.Append(CCFLAGS=["-W3", "-GR"])
    if env["target"] in ("debug", "d"):
        env.Append(CPPDEFINES=["_DEBUG"])
        env.Append(CCFLAGS=["-EHsc", "-MDd", "-ZI"])
        env.Append(LINKFLAGS=["-DEBUG"])
    else:
        env.Append(CPPDEFINES=["NDEBUG"])
        env.Append(CCFLAGS=["-O2", "-EHsc", "-MD"])

this isnt read even if you pass: platform=windows because of lines 6-15 if you comment them and give an empty value to host_platform it works. But still cant compile to windows!

Activity

  1. added
    bugThis has been identified as a bug
    on Aug 31, 2021
  2. added this to the 4.0 milestone on Sep 4, 2021
  3. modified the milestones: 4.0, 4.x on Jul 8, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugThis has been identified as a bugtopic:gdextensionThis relates to the new Godot 4 extension implementation

    Type

    No type

    Projects

    No projects

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions