premake / premake/premake-core

Request: More Examples

Open
#458 8 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

enhancement help wanted question
Dominant language
C
Stars
3.6k
Forks
654
Avg merge
1d 1h
Merged PRs (30d)
13

Description

While the 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 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 SDL2 or 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.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Read the wiki's Your First Script page and the linked dependson documentation first, then review the existing Premake examples. Define a small, well-commented premake5.lua workspace covering the requested library, application, optional tests, and platform targets; done means the example and its explanatory wiki content are complete and build as described.

Written by the indexing model from the issue text.

Assessment

Tech stack
lua
Domain
build-system, documentation
Issue type
Documentation
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
28/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.