Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Building with 'platform=x11' fails in spite of alias to 'linuxbsd' #37465

Closed
accidentalrebel opened this issue Mar 31, 2020 · 2 comments · Fixed by #37468
Closed

Building with 'platform=x11' fails in spite of alias to 'linuxbsd' #37465

accidentalrebel opened this issue Mar 31, 2020 · 2 comments · Fixed by #37468

Comments

@accidentalrebel
Copy link
Contributor

accidentalrebel commented Mar 31, 2020

Godot version:
Master branch
#37153

Godot Engine v4.0.dev.custom_build.8dd58a615

OS/device including version:
Linux 5.5.13-arch1-1 x86_64

Steps to reproduce:
Run the command:
scons -j8 platform=x11

Issue description:
Specifying the command below:

scons -j8 platform=x11

Produces the build error:

thirdparty/vulkan/loader/loader.c:81:10: fatal error: loader_cmake_config.h: No such file or directory
   81 | #include "loader_cmake_config.h"
      |          ^~~~~~~~~~~~~~~~~~~~~~~
compilation terminated.
scons: *** [thirdparty/vulkan/loader/loader.linuxbsd.tools.64.o] Error 1
Ranlib Library         ==> modules/libmodule_assimp.linuxbsd.tools.64.a
scons: building terminated because of errors.

If we are to use platform=linuxbsd then there are no problems with building.

The error can be traced to loader_cmake_config.h needing VULKAN_NON_CMAKE_BUILD to be defined. The setting of this can then be traced to the file drivers/vulkan/SCsub.

 elif env["platform"] == "linuxbsd":
        env_thirdparty.AppendUnique(
            CPPDEFINES=[
                "VK_USE_PLATFORM_XLIB_KHR",
                "VULKAN_NON_CMAKE_BUILD",
                'SYSCONFDIR=\\"%s\\"' % "/etc",
                'FALLBACK_DATA_DIRS=\\"%s\\"' % "/usr/local/share:/usr/share",
                'FALLBACK_CONFIG_DIRS=\\"%s\\"' % "/etc/xdg",
            ]
        )

There is a commit #37369 that made an alias that turns platform=x11 to platform=linuxbsd. Unfortunately, this alias does not seem to carry over to SCsub.

Possible fix:
Adding checks for the other aliases in #37369 in SCsub is proven to fix the problem.

elif env["platform"] == "linuxbsd" or env["platform"] == "x11" or env["platform"] == "linux" or env["platform"] == "bsd":

I am open to fixing this and making a pull request. However, I am unsure if the possible fix above is the correct approach. Any help would be appreciated.

Thanks!

@akien-mga
Copy link
Member

The fix is to set env_base["platform"] properly in SConstruct when defining the alias.

@accidentalrebel
Copy link
Contributor Author

Aha. I missed that. I tried it and it works. Will submit a PR.

accidentalrebel added a commit to accidentalrebel/godot that referenced this issue Mar 31, 2020
Fixes godotengine#37465. The godotengine#37369 commit which added an alias for linuxbsd
platform did not work with the latest branch.
@Calinou Calinou added this to the 4.0 milestone Mar 31, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants