summaryrefslogtreecommitdiff
path: root/src/main.c
blob: 237bca3758647733689e72162efcc50472a959dc (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
#define _CB_LOG_TO_FILE
#define CB_DEBUG
#define _CB_IMPLEMENTATION
#include "./lib/stb_cbuild.h"







static _CB_PROJECT *rebuild = {0};
static _CB_PROJECT *pjt = {0};

int main(int argc, char **argv) {
  _CB_CREATE_PROJECT(pjt,
    .name = "test",
    .output = "./bin/test",
    .files = CB_STRLIST("main.c"),
    .buildflags = CB_STRLIST("-Wall"),
    .is_rebuild = 1,
    .flags = CB_STRLIST("C Build") 
  );
  _CB_CREATE_PROJECT(rebuild,
      .name = "cb_rebuild",
      .output = "./bin/cbuild",
      .files = CB_STRLIST("./src/main.c"),
      .is_rebuild = 1,
      );


  _CB_PROJECT_BUILD(
      .projects = CB_PROJECT_LIST(rebuild),
      .parallel = 0,
      .run = 0,
     );

  _CB_PROJECT_BUILD(
      .projects = CB_PROJECT_LIST(pjt),
      .run = 1,
      .parallel = 0,
      .run_if_skipped = 1
      );


  cb_free_project(pjt);
  cb_free_project(rebuild);

  return EXIT_SUCCESS;
}