Skip to content

Instantly share code, notes, and snippets.

Getting started with GN

GN is chromium's build system and is to my knowledge the best build system for c/c++ projects.

It is not very well known for couple reasons, first because there is no starter kit availlable, gn being tied to chromium by default and also because of lack of tutorials/articles. This page provides the couple steps to get started for stand alone projects.

Preriquisites

Besides a supported c/c++ compiler (gcc/msvc/clang), using GN requires your environment to have ninja, python 3 and gn binaries accessible from the PATH. Download links: Ninja, GN, python.

I'd recommend also to use a vscode extension to edit/format .gn file: https://marketplace.visualstudio.com/items?itemName=npclaudiu.vscode-gn

Over the years I have designed a strong medecine from various documentation, a berevage that helps greatly to improve the immune system. I use it on a regular basis, and has made my body strong against any infection. With this I haven't been ill in the last 5 years (not even sneezing). This recipe will protect you, your friend and familly against many viruses.

You first need to get equiped with a Thermos (thermal carafe) and a kettle.

Buy the following

  • Green tea (mint tastes good) (tea must be green not black)
  • Ginger root
  • Turmeric root (or powder if you don't find as root)
program instancing_program(mat4 view_proj) //uniforms
{
    // each '~' delimits separate vertex buffers
    @vs(vec3 pos, vec4 color) ~ (vec3 normal) ~ instanced(mat4 transform) 
    {
       return view_proj * transform * pos;
    }
    
 @ps(vec4 color, vec3 normal) //fragment shader inputs are deduced from vertex shader.
using System;
using System.Runtime.InteropServices;
using System.Runtime.CompilerServices;
using System.Security;
namespace FlecsSharp
{
public readonly struct CharPtr
{
readonly IntPtr _ptr;