Cannot compile in windows WSL
Andrea-Miele opened this issue · 6 comments
Godot version:
3.2
OS/device including version:
Windows 10 WSL
Issue description:
Cannot build for switch. Invalid target platform "switch".
The following platforms were detected:
server
This is not a duplicate of #15
Steps to reproduce:
Install Devkitpro
Set environment variables
Clone this git repository
Run scons platform=switch in the root of the repo
I can't reproduce this on my own WSL install - can you show the full scons output?
There's 2 things that can cause this - either unset environment variables, or missing packages.
Make sure you're on the correct branch with git checkout 3.2.3-stable_switch
- the master
branch in this repo is the vanilla Godot source code without Switch support.
Also, are you building for a particular reason? The releases on the repo's releases page should work unless you need custom c++ modules or something.
scons: Reading SConscript files ...
DEVKITPRO not defined in environment.. switch diabled.
Package x11 was not found in the pkg-config search path.
Perhaps you should add the directory containing `x11.pc'
to the PKG_CONFIG_PATH environment variable
No package 'x11' found
Automatically detected platform: x11
Invalid target platform "x11".
The following platforms were detected:
server
I set the environment variable DEVKITPRO to /opt/devkitpro and it showed this
scons: Reading SConscript files ...
devkitA64 not found.. switch disabled.
Package x11 was not found in the pkg-config search path.
Perhaps you should add the directory containing `x11.pc'
to the PKG_CONFIG_PATH environment variable
No package 'x11' found
Automatically detected platform: x11
Invalid target platform "x11".
The following platforms were detected:
server
Please run SCons again and select a valid platform: platform=
So I installed switch-dev using dkp-pacman and it showed this
scons --platform=switch
scons: Reading SConscript files ...
Package x11 was not found in the pkg-config search path.
Perhaps you should add the directory containing `x11.pc'
to the PKG_CONFIG_PATH environment variable
No package 'x11' found
Automatically detected platform: x11
Invalid target platform "x11".
The following platforms were detected:
server
switch
Please run SCons again and select a valid platform: platform=
Scons automatically select the platform x11
I want to build because I have windows ARM64
I resolved the problem of x11 with this command
apt install libx11-dev libxinerama-dev libxcursor-dev libxrandr-dev libxi-dev
Now I get this error
scons --platform=switch
scons: Reading SConscript files ...
Automatically detected platform: x11
ALSA libraries not found, disabling driver
PulseAudio development libraries not found, disabling driver
Checking for C header file mntent.h... yes
scons: done reading SConscript files.
usage: scons [OPTION] [TARGET] ...
SCons Error: no such option: --platform
So I run this command
scons platform=switch
The build now start correctly
I have another question, how can I use my games on nintendo switch without do a jailbreak? I have a nintendo switch 1.11.1
Compiling with platform=switch
is building the engine for the Switch, not the editor for Windows! The x11 target is building for Linux, which I doubt will work properly inside WSL... take a look at https://docs.godotengine.org/en/stable/development/compiling/compiling_for_windows.html for how to build for Windows.
I don't know if Godot actually supports running on ARM64 windows yet, so you might need to make a 32 bit x86 windows build and run it under x86 emulation.
You can't use godot on Switch without some form of exploit - if you have a non-exploitable switch and are on the latest software version you're out of luck. Currently it doesn't run in Switch emulators, which I plan to fix eventually...
Thank you