SpartanJ / eepp

eepp is an open source cross-platform game and application development framework heavily focused on the development of rich graphical user interfaces.
https://eepp.ensoft.dev
MIT License
431 stars 36 forks source link

Premake4 build script is broken #33

Closed ghost closed 6 months ago

ghost commented 6 months ago

I invoked premake4 gmake. It worked without any errors. But when I build it with make -e config=release_x86_64 -C make/windows, it will only print this and do nothing:

$ make -e config=release_x86_64 -C make/windows
make: Entering directory '/home/Administrator/test/eepp/make/windows'
==== Building SOIL2-static (release_x86_64) ====
==== Building chipmunk-static (release_x86_64) ====
==== Building efsw-static (release_x86_64) ====
==== Building eterm-static (release_x86_64) ====
==== Building freetype-static (release_x86_64) ====
==== Building libpng-static (release_x86_64) ====
==== Building libzip-static (release_x86_64) ====
==== Building jpeg-compressor-static (release_x86_64) ====
==== Building zlib-static (release_x86_64) ====
==== Building imageresampler-static (release_x86_64) ====
==== Building pugixml-static (release_x86_64) ====
==== Building vorbis-static (release_x86_64) ====
==== Building mojoal-static (release_x86_64) ====
==== Building mbedtls-static (release_x86_64) ====
==== Building glew-static (release_x86_64) ====
==== Building eepp-shared (release_x86_64) ====
==== Building ecode (release_x86_64) ====
==== Building eepp-7guis-cells (release_x86_64) ====
==== Building eepp-7guis-circle-drawer (release_x86_64) ====
==== Building eepp-7guis-counter (release_x86_64) ====
==== Building eepp-7guis-crud (release_x86_64) ====
==== Building eepp-7guis-flight-booker (release_x86_64) ====
==== Building eepp-7guis-temperature-converter (release_x86_64) ====
==== Building eepp-7guis-timer (release_x86_64) ====
==== Building eepp-empty-window (release_x86_64) ====
==== Building eepp-external-shader (release_x86_64) ====
==== Building eepp-fonts (release_x86_64) ====
==== Building eepp-http-request (release_x86_64) ====
==== Building eepp-maps-static (release_x86_64) ====
==== Building eepp-mapeditor (release_x86_64) ====
==== Building eepp-maps (release_x86_64) ====
==== Building eepp-physics (release_x86_64) ====
==== Building eepp-physics-static (release_x86_64) ====
==== Building eepp-physics-demo (release_x86_64) ====
==== Building eepp-sound (release_x86_64) ====
==== Building eepp-sprites (release_x86_64) ====
==== Building eepp-static (release_x86_64) ====
==== Building eepp-test (release_x86_64) ====
==== Building eepp-textureatlaseditor (release_x86_64) ====
==== Building eepp-texturepacker (release_x86_64) ====
==== Building eepp-ui-hello-world (release_x86_64) ====
==== Building eepp-ui-perf-test (release_x86_64) ====
==== Building eepp-uieditor (release_x86_64) ====
==== Building eepp-vbo-fbo-batch (release_x86_64) ====
==== Building eterm (release_x86_64) ====
make: Leaving directory '/home/Administrator/test/eepp/make/windows'

It seems the script can't register new platforms.

ghost commented 6 months ago

If I use make -e config=release -C make/windows, it will proceed to compile but finally failed at linking. It selected the wrong .res file:

Linking eepp-external-shader
ld.lld: error: ../../bin/assets/icon/ee.res: machine type x86 conflicts with x64
g++: error: linker command failed with exit code 1 (use -v to see invocation)
make[1]: *** [eepp-external-shader.make:86: ../../bin/eepp-external-shader.exe] Error 1
make: *** [Makefile:101: eepp-external-shader] Error 2

I inspected the object files. They are 64 bit. The host is MSYS2 CLANG64.

It seems it's thinking it's building for x86.

Update: make -C make/windows failed with the same error.

SpartanJ commented 6 months ago

This is also not supported.

SpartanJ commented 6 months ago

Just to add: I tried this last weekend to add support for MSYS2 but I have a very annoying problem I couldn't fix: mkdir fails to create the obj folder paths. I couldn't find a fix, the only way to build it is by creating the folders manually which is ridiculous. It doesn't work on cmd nor msys terminal. So I gave up. I updated the documentation because of that, since I use a very different setup, I know there are multiple ways of building it but I cannot support each and every one, also don't personally use Windows so I'm not very knowledgeable of the environment so I don't have enough patience or motivation to fight for hours with these kind of things. I'll provide how to build it and if people want to provide patches to improve the compatibility with other environments it will be more than welcome.

ghost commented 6 months ago

Just to add: I tried this last weekend to add support for MSYS2 but I have a very annoying problem I couldn't fix: mkdir fails to create the obj folder paths. I couldn't find a fix, the only way to build it is by creating the folders manually which is ridiculous. It doesn't work on cmd nor msys terminal. So I gave up. I updated the documentation because of that, since I use a very different setup, I know there are multiple ways of building it but I cannot support each and every one, also don't personally use Windows so I'm not very knowledgeable of the environment so I don't have enough patience or motivation to fight for hours with these kind of things. I'll provide how to build it and if people want to provide patches to improve the compatibility with other environments it will be more than welcome.

I have never experienced such problem. When using premake5 (MSYS2 CLANG64 package mingw-w64-clang-x86_64-premake), everything is straight forward. The only thing you have to keep in mind is you have to use make (POSIX) instead of mingw32-make (Win32) as I have noted on https://github.com/SpartanJ/ecode/issues/141.

ghost commented 6 months ago

Premake5 works fine. The reason why I tried Premake4 is because I want to port the Premake4 build script to GENie to use the Ninja generator of it. Please see: https://github.com/bkaradzic/GENie/issues/561. I found that it's problematic with GENie. I tested with Premake4 and it turned out the it has the same problem.

SpartanJ commented 6 months ago

That's a good observation, since if you use POSIX it will use the POSIX mkdir (mkdir -p). So you skipped the problem. Good to know it works, I'll try it. Thanks. But don't use the premake4 project, it's really not ready for the build you're trying. I kept the premake4 project for some other builds (emscripten mostly).

SpartanJ commented 6 months ago

Premake5 works fine. The reason why I tried Premake4 is because I want to port the Premake4 build script to GENie to use the Ninja generator of it. Please see: https://github.com/bkaradzic/GENie/issues/561. I found that it's problematic with GENie. I tested with Premake4 and it turned out the it has the same problem.

That's something I'm tempted to do at some point. premake as a project seems too abandoned. But it's a huge work to port everything properly (I'm supporting multiple OS, build types, etc). I also have been looking into xmake, which I like it. But... I always prefer to continue adding features than fighting with compilers and environments, that's not fun.

SpartanJ commented 6 months ago

CMake and Meson are the industrial standards now.

But I don't like them. I'll never use CMake on my open source projects, it's an abomination. But I do accept contributions if people want to maintain the build system on my more simple projects like efsw and SOIL2. I'll always try to use what I like on my projects, it's already enough pain to setup a C++ project, so at least I'll try to use the least painful option for me.

ghost commented 6 months ago

CMake and Meson are the industrial standards now.

But I don't like them. I'll never use CMake on my open source projects, it's an abomination.

Yes, CMake sucks.

ghost commented 6 months ago

XMake:

https://lobste.rs/search?q=xmake&what=comments&order=newest