Noxagonal/Vulkan2DRenderer

Python build script

Closed this issue · 3 comments

exuvo commented

I have to ask, is this file really needed for IDEs? Does neither Visual Studio nor Codeblocks have UI options for CMake builds? That seems very strange to me.

In my eclipse IDE i just choose build configuration development or release like usual and it sends the correct options to cmake when building. I can also set CMake options to set (ex VK2D_BUILD_TESTS) or use ninja as generator from there.

I also think listing Python as a required dependency for building is incorrect as you can just use standard cmake usage to build just fine without it. Maybe mark it as optional or only for interactive build.

The build.sh is not needed on linux if you just add #!/bin/python3 at the top of the python file.

And finally i must strongly discourage from suggesting to run sudo ./Build.sh as this will also run the compiler as root. Either a separate user step after the compile like make usage normally does ex sudo make install or run sudo in the build script for just the install command. This is especially relevant seeing as ExternalLibraries is fetched remotely and not under your control what actually gets run during a build.

This python script is basically nothing more than a glorified shortcut and you can be completely ignore it if you prefer. 😄
Nothing will change for users who prefer to use CMake directly or via an IDE.
However this is my effort of trying to make compiling the library as painless as possible for new users and faster for old users.

I'm still ironing out the details on this, I'll take what you said into consideration.
I agree with you about using sudo, I'll be changing that later.
I was considering just doing the Windows route and "installing" everything into a folder if installation was done through the build tool and let the user then install it separately, however I'll have to study if this kind of package management can be done on Linux.

I did some changes. Concerning Linux I mainly just removed option to install via the build tool for now.
"Plain" CMake on VS seems competent enough but I haven't really used it yet. I'll see more about it in the future.

Thank you for your input btw. :)

exuvo commented

Regarding

however I'll have to study if this kind of package management can be done on Linux.

When building packages for linux you usually set the install prefix (-DCMAKE_INSTALL_PREFIX) to a local directory ex /tmp/build (maybe append /usr too), and the cmake --install will put output files there structured usually under /tmp/build/usr/bin or /tmp/build/usr/include.

Then your linux's packaging system (on archlinux makepgk) turns that directory into a package file with some extra metadata files for package version etc.

The final package is then installed via a package manager running as root. In this way you avoid having to run any untrusted buildscript as root.

Only on linux installations without a package manager would you ever directly run [c]make install as root.