Skip to content

inonitz/flip-fluid-3d

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Contributors Forks Stargazers MIT


Multi-Project Workspace Template

C/C++ Cross-Platform Multi-Project Template

About The Project

I needed to manage multiple projects in a single cross-platform-workspace with easy integration to clangd
I had multiple options:

  • Makefile - Will not go back to those
  • cmake - Industry standard, should've probably used that
  • xmake - I didn't need an alternative to CMAKE
  • premake - A meta build system with lua syntax (also like xmake, except more barebones)

Equipped with a new tool, I started migrating my previous project because recompilation targets were non-existent
This project is the result!

Project Structure

Each Project contains a premake5.lua file, describing everything about its compilation/linking There are 5 sub-projects available as reference/guiding points if you don't understand the Explanation below

  • To add a project to compilation/linking:
    • Add the path at projects/lua
    • Specify a LinkMyLibraryName function at the root premake5.lua file (see LinkImGuiLibrary() for more info)
    • Use IncludeProjectHeaders(...) & LinkMyLibraryName in your library/executable' premake5.lua
  • To add a dependency to compilation/linking:
    • Add your library to the folder dependencies/
    • Specify 2 functions at the root premake5.lua file:
      • LinkMyLibraryName
      • IncludeProjectHeaders
    • Use The defined functions in your library/executable' premake5.lua

Built With




GLFW v3.4                 ImGui                 Premake

Getting Started

Prerequisites

Installation

There are 2 branches available:

  • with-subprojects - Includes ImGui, GLFW, glbinding, awc2 and a sample program at program/
  • barebones - Executable-With-Library Samples, including reference premake files for:
    • ImGui
    • GLFW
    • glbinding
    • awc2
# If you want everything
git clone -b with-subprojects https://github.com/inonitz/premake5-workspace-template.git
# If you prefer to configure on your own
git clone -b barebones https://github.com/inonitz/premake5-workspace-template.git
# Don't forget to add your own remote repo
git remote set-url origin your_github_username/premake5-workspace-template
git remote -v

Usage

call premake5 help in the cloned repo directory (.vscode/..)

Common Commands:

    premake5 --proj=program cleanproj 
    premake cleanall 
    premake cleancfgs
    premake cleanclangd
    premake export-compile-commands
    premake --os=windows --arch=x86_64 --cc=clang gmake2
    premake --os=windows --arch=x86_64 --cc=clang vs2022
    premake --os=linux --arch=x86_64 --cc=clang gmake2

Roadmap

  • Adding an option to delete files based on architecture (e.g cleanarch --arch='x')
  • Optimization of execution time:
    • with-subprojects branch
      • ~7sec [windows]
      • ~4sec [wsl2]
    • barebones branch
      • ~242ms [windows]

Contributing

If you have a suggestion, please fork the repo and create a pull request. You can also simply open an issue with the tag "enhancement".

License

Distributed under the MIT License. See LICENSE file for more information.

Acknowledgements

About

Implementation of a FLIP-type Fluid Visualized in 3D

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages