premake/premake-core

Request: More Examples

Ouverte

#458 ouverte le 29 mars 2016

 (8 commentaires) (0 réaction) (0 personne assignée)C (651 forks)auto 404
enhancementhelp wantedquestion

Métriques du dépôt

Stars
 (3 621 étoiles)
Métriques de merge PR
 (Métriques PR en attente)

Description

While the <a href=https://github.com/premake/premake-core/wiki/Your-First-Script>Hello World script is useful to get a small taste for what premake can do, I feel that there simply are not enough examples for someone to look at to get an idea of how to use it for a real project.

While perusing the wiki can help you learn about new functionality that you may want to use in projects, it's often far nicer to see a complete and working project, and how they choose to structure their code.

Sure, there are other repositories out there that rely on premake, but their scripts are often huge, barely commented, and often use deprecated functionality, or are just too complicated for a quick reference. As often in computer science, there's an effective learning cliff from trivial to very complex, with very little in-between.

I understand that with every project, how you structure your premake5.lua is unique and depends on the developer's style, their project's needs, and target goals, but nonetheless I find myself wishing for a step a little above "hello world", something that shows good practices for a non-trivial, but still simple, cross-platform example.

Basically here is my wishlist:

  • A single, well-commented premake5.lua workspace
  • Two projects: A simple static library and a windowed application that <a href=https://github.com/premake/premake-core/wiki/dependson>`dependson` the library. Bonus would be having a 3rd project for unit testing.
  • Cross platform, so it can compile for Mac and Linux with gmake, and for Windows with visual studio (2013 or later).
  • It links to some dynamic library such as <a href=https://www.libsdl.org/download-2.0.php>SDL2 or <a href=http://www.glfw.org/>GLFW so it could even just be a simple "hello triangle" OpenGL program.
  • On Mac it should wrap up the unix executable in an actual, correctly formatted .app application, including moving the dynamic library(s) to their respective folder(s) inside 'Contents' and adjusting the rpath accordingly.
  • A dedicated wiki page that walks you through the rationale for the layout of each section would be ideal, but not necessary.

I feel that new users would really benefit from a "hello world 2" like this.


An alternative would be to just have add an "Additional Examples" wiki page that follows the 'Your First Script' section, with links to repositories of projects that are known to use premake5, that have been vetted for clean structure and good practices, and so are deemed useful as examples for someone wanting to learn more about what premake can be used for, or just wants inspiration for how they could improve their own projects.

Guide contributeur