Properly link flecs library

This commit is contained in:
2023-11-09 11:38:29 +01:00
parent dc585396c3
commit 8edcf9305c
1392 changed files with 390081 additions and 164 deletions

View File

@@ -0,0 +1,16 @@
#ifndef DEFINE_DEBUG_AND_SANITIZE_H
#define DEFINE_DEBUG_AND_SANITIZE_H
/* This generated file contains includes for project dependencies */
#include "define_debug_and_sanitize/bake_config.h"
#ifdef __cplusplus
extern "C" {
#endif
#ifdef __cplusplus
}
#endif
#endif

View File

@@ -0,0 +1,24 @@
/*
)
(.)
.|.
| |
_.--| |--._
.-'; ;`-'& ; `&.
\ & ; & &_/
|"""---...---"""|
\ | | | | | | | /
`---.|.|.|.---'
* This file is generated by bake.lang.c for your convenience. Headers of
* dependencies will automatically show up in this file. Include bake_config.h
* in your main project file. Do not edit! */
#ifndef DEFINE_DEBUG_AND_SANITIZE_BAKE_CONFIG_H
#define DEFINE_DEBUG_AND_SANITIZE_BAKE_CONFIG_H
/* Headers of public dependencies */
#include <flecs.h>
#endif

View File

@@ -0,0 +1,13 @@
{
"id": "define_debug_and_sanitize",
"type": "application",
"value": {
"use": [
"flecs"
],
"public": false
},
"lang.c": {
"defines": ["FLECS_DEBUG", "FLECS_SANITIZE"]
}
}

View File

@@ -0,0 +1,7 @@
#include <define_debug_and_sanitize.h>
#include <stdio.h>
int main(int argc, char *argv[]) {
ecs_world_t *world = ecs_init_w_args(argc, argv);
return ecs_fini(world);
}

View File

@@ -0,0 +1,16 @@
#ifndef LOG_H
#define LOG_H
/* This generated file contains includes for project dependencies */
#include "log/bake_config.h"
#ifdef __cplusplus
extern "C" {
#endif
#ifdef __cplusplus
}
#endif
#endif

View File

@@ -0,0 +1,24 @@
/*
)
(.)
.|.
| |
_.--| |--._
.-'; ;`-'& ; `&.
\ & ; & &_/
|"""---...---"""|
\ | | | | | | | /
`---.|.|.|.---'
* This file is generated by bake.lang.c for your convenience. Headers of
* dependencies will automatically show up in this file. Include bake_config.h
* in your main project file. Do not edit! */
#ifndef LOG_BAKE_CONFIG_H
#define LOG_BAKE_CONFIG_H
/* Headers of public dependencies */
#include "../../deps/flecs.h"
#endif

View File

@@ -0,0 +1,14 @@
{
"id": "log",
"type": "application",
"value": {
"public": false,
"use": [
"flecs"
],
"standalone": true
},
"lang.c": {
"defines": ["FLECS_CUSTOM_BUILD", "FLECS_LOG"]
}
}

View File

@@ -0,0 +1,7 @@
#include <log.h>
int main(int argc, char *argv[]) {
ecs_world_t *world = ecs_init_w_args(argc, argv);
return ecs_fini(world);
}

View File

@@ -0,0 +1,16 @@
#ifndef META_H
#define META_H
/* This generated file contains includes for project dependencies */
#include "meta/bake_config.h"
#ifdef __cplusplus
extern "C" {
#endif
#ifdef __cplusplus
}
#endif
#endif

View File

@@ -0,0 +1,24 @@
/*
)
(.)
.|.
| |
_.--| |--._
.-'; ;`-'& ; `&.
\ & ; & &_/
|"""---...---"""|
\ | | | | | | | /
`---.|.|.|.---'
* This file is generated by bake.lang.c for your convenience. Headers of
* dependencies will automatically show up in this file. Include bake_config.h
* in your main project file. Do not edit! */
#ifndef META_BAKE_CONFIG_H
#define META_BAKE_CONFIG_H
/* Headers of public dependencies */
#include "../../deps/flecs.h"
#endif

View File

@@ -0,0 +1,14 @@
{
"id": "meta",
"type": "application",
"value": {
"public": false,
"use": [
"flecs"
],
"standalone": true
},
"lang.c": {
"defines": ["FLECS_CUSTOM_BUILD", "FLECS_META"]
}
}

View File

@@ -0,0 +1,15 @@
#include <meta.h>
int main(int argc, char *argv[]) {
ecs_world_t *world = ecs_init_w_args(argc, argv);
ecs_entity_t s = ecs_struct_init(world, &(ecs_struct_desc_t){
.members = {
{ .name = "x", .type = ecs_id(ecs_i32_t) },
{ .name = "y", .type = ecs_id(ecs_i32_t) }
}
});
assert(s != 0);
return ecs_fini(world);
}

View File

@@ -0,0 +1,16 @@
#ifndef META_C_H
#define META_C_H
/* This generated file contains includes for project dependencies */
#include "meta_c/bake_config.h"
#ifdef __cplusplus
extern "C" {
#endif
#ifdef __cplusplus
}
#endif
#endif

View File

@@ -0,0 +1,24 @@
/*
)
(.)
.|.
| |
_.--| |--._
.-'; ;`-'& ; `&.
\ & ; & &_/
|"""---...---"""|
\ | | | | | | | /
`---.|.|.|.---'
* This file is generated by bake.lang.c for your convenience. Headers of
* dependencies will automatically show up in this file. Include bake_config.h
* in your main project file. Do not edit! */
#ifndef META_C_BAKE_CONFIG_H
#define META_C_BAKE_CONFIG_H
/* Headers of public dependencies */
#include "../../deps/flecs.h"
#endif

View File

@@ -0,0 +1,14 @@
{
"id": "meta_c",
"type": "application",
"value": {
"public": false,
"use": [
"flecs"
],
"standalone": true
},
"lang.c": {
"defines": ["FLECS_CUSTOM_BUILD", "FLECS_META_C"]
}
}

View File

@@ -0,0 +1,14 @@
#include <meta_c.h>
ECS_STRUCT(Position, {
float x;
float y;
});
int main(int argc, char *argv[]) {
ecs_world_t *world = ecs_init_w_args(argc, argv);
ECS_META_COMPONENT(world, Position);
return ecs_fini(world);
}

View File

@@ -0,0 +1,5 @@
.bake_cache
.DS_Store
.vscode
gcov
bin

View File

@@ -0,0 +1,16 @@
#ifndef MODULE_H
#define MODULE_H
/* This generated file contains includes for project dependencies */
#include "module/bake_config.h"
#ifdef __cplusplus
extern "C" {
#endif
#ifdef __cplusplus
}
#endif
#endif

View File

@@ -0,0 +1,24 @@
/*
)
(.)
.|.
| |
_.--| |--._
.-'; ;`-'& ; `&.
\ & ; & &_/
|"""---...---"""|
\ | | | | | | | /
`---.|.|.|.---'
* This file is generated by bake.lang.c for your convenience. Headers of
* dependencies will automatically show up in this file. Include bake_config.h
* in your main project file. Do not edit! */
#ifndef MODULE_BAKE_CONFIG_H
#define MODULE_BAKE_CONFIG_H
/* Headers of public dependencies */
#include "../../deps/flecs.h"
#endif

View File

@@ -0,0 +1,13 @@
#include <module.h>
void MyModuleImport(ecs_world_t *world) {
ECS_MODULE(world, MyModule);
}
int main(int argc, char *argv[]) {
ecs_world_t *world = ecs_init_w_args(argc, argv);
ECS_IMPORT(world, MyModule);
return ecs_fini(world);
}

View File

@@ -0,0 +1,16 @@
#ifndef REST_H
#define REST_H
/* This generated file contains includes for project dependencies */
#include "monitor/bake_config.h"
#ifdef __cplusplus
extern "C" {
#endif
#ifdef __cplusplus
}
#endif
#endif

View File

@@ -0,0 +1,24 @@
/*
)
(.)
.|.
| |
_.--| |--._
.-'; ;`-'& ; `&.
\ & ; & &_/
|"""---...---"""|
\ | | | | | | | /
`---.|.|.|.---'
* This file is generated by bake.lang.c for your convenience. Headers of
* dependencies will automatically show up in this file. Include bake_config.h
* in your main project file. Do not edit! */
#ifndef MONITOR_BAKE_CONFIG_H
#define MONITOR_BAKE_CONFIG_H
/* Headers of public dependencies */
#include "../../deps/flecs.h"
#endif

View File

@@ -0,0 +1,14 @@
{
"id": "monitor",
"type": "application",
"value": {
"public": false,
"use": [
"flecs"
],
"standalone": true
},
"lang.c": {
"defines": ["FLECS_CUSTOM_BUILD", "FLECS_MONITOR", "FLECS_LOG"]
}
}

View File

@@ -0,0 +1,9 @@
#include <monitor.h>
int main(int argc, char *argv[]) {
ecs_world_t *world = ecs_init_w_args(argc, argv);
ECS_IMPORT(world, FlecsMonitor);
return ecs_fini(world);
}

View File

@@ -0,0 +1,16 @@
#ifndef MONITOR_REST_H
#define MONITOR_REST_H
/* This generated file contains includes for project dependencies */
#include "monitor_rest/bake_config.h"
#ifdef __cplusplus
extern "C" {
#endif
#ifdef __cplusplus
}
#endif
#endif

View File

@@ -0,0 +1,24 @@
/*
)
(.)
.|.
| |
_.--| |--._
.-'; ;`-'& ; `&.
\ & ; & &_/
|"""---...---"""|
\ | | | | | | | /
`---.|.|.|.---'
* This file is generated by bake.lang.c for your convenience. Headers of
* dependencies will automatically show up in this file. Include bake_config.h
* in your main project file. Do not edit! */
#ifndef MONITOR_REST_BAKE_CONFIG_H
#define MONITOR_REST_BAKE_CONFIG_H
/* Headers of public dependencies */
#include "../../deps/flecs.h"
#endif

View File

@@ -0,0 +1,14 @@
{
"id": "monitor_rest",
"type": "application",
"value": {
"public": false,
"use": [
"flecs"
],
"standalone": true
},
"lang.c": {
"defines": ["FLECS_CUSTOM_BUILD", "FLECS_MONITOR", "FLECS_REST", "FLECS_LOG"]
}
}

View File

@@ -0,0 +1,10 @@
#include <monitor_rest.h>
int main(int argc, char *argv[]) {
ecs_world_t *world = ecs_init_w_args(argc, argv);
ECS_IMPORT(world, FlecsMonitor);
ECS_IMPORT(world, FlecsRest);
return ecs_fini(world);
}

View File

@@ -0,0 +1,16 @@
#ifndef NO_ADDONS_H
#define NO_ADDONS_H
/* This generated file contains includes for project dependencies */
#include "no_addons/bake_config.h"
#ifdef __cplusplus
extern "C" {
#endif
#ifdef __cplusplus
}
#endif
#endif

View File

@@ -0,0 +1,24 @@
/*
)
(.)
.|.
| |
_.--| |--._
.-'; ;`-'& ; `&.
\ & ; & &_/
|"""---...---"""|
\ | | | | | | | /
`---.|.|.|.---'
* This file is generated by bake.lang.c for your convenience. Headers of
* dependencies will automatically show up in this file. Include bake_config.h
* in your main project file. Do not edit! */
#ifndef NO_ADDONS_BAKE_CONFIG_H
#define NO_ADDONS_BAKE_CONFIG_H
/* Headers of public dependencies */
#include "../../deps/flecs.h"
#endif

View File

@@ -0,0 +1,14 @@
{
"id": "no_addons",
"type": "application",
"value": {
"public": false,
"use": [
"flecs"
],
"standalone": true
},
"lang.c": {
"defines": ["FLECS_CUSTOM_BUILD"]
}
}

View File

@@ -0,0 +1,7 @@
#include <no_addons.h>
int main(int argc, char *argv[]) {
ecs_world_t *world = ecs_init_w_args(argc, argv);
return ecs_fini(world);
}

View File

@@ -0,0 +1,16 @@
#ifndef NO_LOG_H
#define NO_LOG_H
/* This generated file contains includes for project dependencies */
#include "no_log/bake_config.h"
#ifdef __cplusplus
extern "C" {
#endif
#ifdef __cplusplus
}
#endif
#endif

View File

@@ -0,0 +1,24 @@
/*
)
(.)
.|.
| |
_.--| |--._
.-'; ;`-'& ; `&.
\ & ; & &_/
|"""---...---"""|
\ | | | | | | | /
`---.|.|.|.---'
* This file is generated by bake.lang.c for your convenience. Headers of
* dependencies will automatically show up in this file. Include bake_config.h
* in your main project file. Do not edit! */
#ifndef NO_LOG_BAKE_CONFIG_H
#define NO_LOG_BAKE_CONFIG_H
/* Headers of public dependencies */
#include "../../deps/flecs.h"
#endif

View File

@@ -0,0 +1,14 @@
{
"id": "no_log",
"type": "application",
"value": {
"public": false,
"use": [
"flecs"
],
"standalone": true
},
"lang.c": {
"defines": ["FLECS_NO_LOG"]
}
}

View File

@@ -0,0 +1,12 @@
#include <no_log.h>
int main(int argc, char *argv[]) {
ecs_world_t *world = ecs_init_w_args(argc, argv);
assert(ecs_should_log(-1) == false);
assert(ecs_should_log(0) == false);
assert(ecs_should_log(1) == false);
assert(ecs_should_log(2) == false);
return ecs_fini(world);
}

View File

@@ -0,0 +1,16 @@
#ifndef PIPELINE_H
#define PIPELINE_H
/* This generated file contains includes for project dependencies */
#include "pipeline/bake_config.h"
#ifdef __cplusplus
extern "C" {
#endif
#ifdef __cplusplus
}
#endif
#endif

View File

@@ -0,0 +1,24 @@
/*
)
(.)
.|.
| |
_.--| |--._
.-'; ;`-'& ; `&.
\ & ; & &_/
|"""---...---"""|
\ | | | | | | | /
`---.|.|.|.---'
* This file is generated by bake.lang.c for your convenience. Headers of
* dependencies will automatically show up in this file. Include bake_config.h
* in your main project file. Do not edit! */
#ifndef PIPELINE_BAKE_CONFIG_H
#define PIPELINE_BAKE_CONFIG_H
/* Headers of public dependencies */
#include "../../deps/flecs.h"
#endif

View File

@@ -0,0 +1,14 @@
{
"id": "pipeline",
"type": "application",
"value": {
"public": false,
"use": [
"flecs"
],
"standalone": true
},
"lang.c": {
"defines": ["FLECS_CUSTOM_BUILD", "FLECS_PIPELINE"]
}
}

View File

@@ -0,0 +1,41 @@
#include <pipeline.h>
typedef struct {
int32_t x, y;
} Position, Velocity;
void Move(ecs_iter_t *it) {
Position *p = ecs_field(it, Position, 1);
Velocity *v = ecs_field(it, Velocity, 2);
for (int i = 0; i < it->count; i ++) {
p[i].x += v[i].x;
p[i].y += v[i].y;
}
}
int main(int argc, char *argv[]) {
ecs_world_t *world = ecs_init_w_args(argc, argv);
ECS_COMPONENT(world, Position);
ECS_COMPONENT(world, Velocity);
ecs_entity_t s = ecs_system_init(world, &(ecs_system_desc_t){
.entity = ecs_entity(world, {.add = { ecs_dependson(EcsOnUpdate) }}),
.query.filter.terms = {{ .id = ecs_id(Position) }, { .id = ecs_id(Velocity) }},
.callback = Move
});
assert(s != 0);
ecs_entity_t e = ecs_new_id(world);
ecs_set(world, e, Position, {10, 20});
ecs_set(world, e, Velocity, {1, 2});
ecs_progress(world, 0);
const Position *p = ecs_get(world, e, Position);
assert(p->x == 11);
assert(p->y == 22);
return ecs_fini(world);
}

View File

@@ -0,0 +1,24 @@
/*
)
(.)
.|.
| |
_.--| |--._
.-'; ;`-'& ; `&.
\ & ; & &_/
|"""---...---"""|
\ | | | | | | | /
`---.|.|.|.---'
* This file is generated by bake.lang.c for your convenience. Headers of
* dependencies will automatically show up in this file. Include bake_config.h
* in your main project file. Do not edit! */
#ifndef PIPELINE_BAKE_CONFIG_H
#define PIPELINE_BAKE_CONFIG_H
/* Headers of public dependencies */
#include "../../deps/flecs.h"
#endif

View File

@@ -0,0 +1,16 @@
#ifndef PIPELINE_W_SYSTEM_H
#define PIPELINE_W_SYSTEM_H
/* This generated file contains includes for project dependencies */
#include "pipeline_w_system/bake_config.h"
#ifdef __cplusplus
extern "C" {
#endif
#ifdef __cplusplus
}
#endif
#endif

View File

@@ -0,0 +1,24 @@
/*
)
(.)
.|.
| |
_.--| |--._
.-'; ;`-'& ; `&.
\ & ; & &_/
|"""---...---"""|
\ | | | | | | | /
`---.|.|.|.---'
* This file is generated by bake.lang.c for your convenience. Headers of
* dependencies will automatically show up in this file. Include bake_config.h
* in your main project file. Do not edit! */
#ifndef PIPELINE_W_SYSTEM_BAKE_CONFIG_H
#define PIPELINE_W_SYSTEM_BAKE_CONFIG_H
/* Headers of public dependencies */
#include "../../deps/flecs.h"
#endif

View File

@@ -0,0 +1,14 @@
{
"id": "pipeline_w_system",
"type": "application",
"value": {
"public": false,
"use": [
"flecs"
],
"standalone": true
},
"lang.c": {
"defines": ["FLECS_CUSTOM_BUILD", "FLECS_PIPELINE", "FLECS_SYSTEM"]
}
}

View File

@@ -0,0 +1,41 @@
#include <pipeline_w_system.h>
typedef struct {
int32_t x, y;
} Position, Velocity;
void Move(ecs_iter_t *it) {
Position *p = ecs_field(it, Position, 1);
Velocity *v = ecs_field(it, Velocity, 2);
for (int i = 0; i < it->count; i ++) {
p[i].x += v[i].x;
p[i].y += v[i].y;
}
}
int main(int argc, char *argv[]) {
ecs_world_t *world = ecs_init_w_args(argc, argv);
ECS_COMPONENT(world, Position);
ECS_COMPONENT(world, Velocity);
ecs_entity_t s = ecs_system_init(world, &(ecs_system_desc_t){
.entity = ecs_entity(world, { .add = {ecs_dependson(EcsOnUpdate)} }),
.query.filter.terms = {{ .id = ecs_id(Position) }, { .id = ecs_id(Velocity) }},
.callback = Move
});
assert(s != 0);
ecs_entity_t e = ecs_new_id(world);
ecs_set(world, e, Position, {10, 20});
ecs_set(world, e, Velocity, {1, 2});
ecs_progress(world, 0);
const Position *p = ecs_get(world, e, Position);
assert(p->x == 11);
assert(p->y == 22);
return ecs_fini(world);
}

View File

@@ -0,0 +1,16 @@
#ifndef PLECS_H
#define PLECS_H
/* This generated file contains includes for project dependencies */
#include "plecs/bake_config.h"
#ifdef __cplusplus
extern "C" {
#endif
#ifdef __cplusplus
}
#endif
#endif

View File

@@ -0,0 +1,24 @@
/*
)
(.)
.|.
| |
_.--| |--._
.-'; ;`-'& ; `&.
\ & ; & &_/
|"""---...---"""|
\ | | | | | | | /
`---.|.|.|.---'
* This file is generated by bake.lang.c for your convenience. Headers of
* dependencies will automatically show up in this file. Include bake_config.h
* in your main project file. Do not edit! */
#ifndef PLECS_BAKE_CONFIG_H
#define PLECS_BAKE_CONFIG_H
/* Headers of public dependencies */
#include "../../deps/flecs.h"
#endif

View File

@@ -0,0 +1,14 @@
{
"id": "plecs",
"type": "application",
"value": {
"public": false,
"use": [
"flecs"
],
"standalone": true
},
"lang.c": {
"defines": ["FLECS_CUSTOM_BUILD", "FLECS_PLECS"]
}
}

View File

@@ -0,0 +1,11 @@
#include <plecs.h>
int main(int argc, char *argv[]) {
ecs_world_t *world = ecs_init_w_args(argc, argv);
int ret = ecs_plecs_from_str(world, NULL, "Foo");
assert(ret == 0);
(void)ret;
ecs_fini(world);
}

View File

@@ -0,0 +1,16 @@
#ifndef PLECS_W_PARSER_H
#define PLECS_W_PARSER_H
/* This generated file contains includes for project dependencies */
#include "plecs_w_parser/bake_config.h"
#ifdef __cplusplus
extern "C" {
#endif
#ifdef __cplusplus
}
#endif
#endif

View File

@@ -0,0 +1,24 @@
/*
)
(.)
.|.
| |
_.--| |--._
.-'; ;`-'& ; `&.
\ & ; & &_/
|"""---...---"""|
\ | | | | | | | /
`---.|.|.|.---'
* This file is generated by bake.lang.c for your convenience. Headers of
* dependencies will automatically show up in this file. Include bake_config.h
* in your main project file. Do not edit! */
#ifndef PLECS_W_PARSER_BAKE_CONFIG_H
#define PLECS_W_PARSER_BAKE_CONFIG_H
/* Headers of public dependencies */
#include "../../deps/flecs.h"
#endif

View File

@@ -0,0 +1,14 @@
{
"id": "plecs_w_parser",
"type": "application",
"value": {
"public": false,
"use": [
"flecs"
],
"standalone": true
},
"lang.c": {
"defines": ["FLECS_CUSTOM_BUILD", "FLECS_PLECS", "FLECS_PARSER"]
}
}

View File

@@ -0,0 +1,11 @@
#include <plecs_w_parser.h>
int main(int argc, char *argv[]) {
ecs_world_t *world = ecs_init_w_args(argc, argv);
int ret = ecs_plecs_from_str(world, NULL, "Foo");
assert(ret == 0);
(void)ret;
ecs_fini(world);
}

View File

@@ -0,0 +1,16 @@
#ifndef REST_H
#define REST_H
/* This generated file contains includes for project dependencies */
#include "rest/bake_config.h"
#ifdef __cplusplus
extern "C" {
#endif
#ifdef __cplusplus
}
#endif
#endif

View File

@@ -0,0 +1,24 @@
/*
)
(.)
.|.
| |
_.--| |--._
.-'; ;`-'& ; `&.
\ & ; & &_/
|"""---...---"""|
\ | | | | | | | /
`---.|.|.|.---'
* This file is generated by bake.lang.c for your convenience. Headers of
* dependencies will automatically show up in this file. Include bake_config.h
* in your main project file. Do not edit! */
#ifndef REST_BAKE_CONFIG_H
#define REST_BAKE_CONFIG_H
/* Headers of public dependencies */
#include "../../deps/flecs.h"
#endif

View File

@@ -0,0 +1,14 @@
{
"id": "rest",
"type": "application",
"value": {
"public": false,
"use": [
"flecs"
],
"standalone": true
},
"lang.c": {
"defines": ["FLECS_CUSTOM_BUILD", "FLECS_REST"]
}
}

View File

@@ -0,0 +1,9 @@
#include <rest.h>
int main(int argc, char *argv[]) {
ecs_world_t *world = ecs_init_w_args(argc, argv);
ecs_set(world, 0, EcsRest, {0});
return ecs_fini(world);
}

View File

@@ -0,0 +1,16 @@
#ifndef GNU2X_H
#define GNU2X_H
/* This generated file contains includes for project dependencies */
#include "gnu2x/bake_config.h"
#ifdef __cplusplus
extern "C" {
#endif
#ifdef __cplusplus
}
#endif
#endif

View File

@@ -0,0 +1,24 @@
/*
)
(.)
.|.
| |
_.--| |--._
.-'; ;`-'& ; `&.
\ & ; & &_/
|"""---...---"""|
\ | | | | | | | /
`---.|.|.|.---'
* This file is generated by bake.lang.c for your convenience. Headers of
* dependencies will automatically show up in this file. Include bake_config.h
* in your main project file. Do not edit! */
#ifndef GNU2X_BAKE_CONFIG_H
#define GNU2X_BAKE_CONFIG_H
/* Headers of public dependencies */
#include "../../deps/flecs.h"
#endif

View File

@@ -0,0 +1,14 @@
{
"id": "gnu2x",
"type": "application",
"value": {
"use": [
"flecs"
],
"standalone": true,
"public": false
},
"lang.c": {
"c-standard": "gnu2x"
}
}

View File

@@ -0,0 +1,7 @@
#include <gnu2x.h>
#include <stdio.h>
int main(int argc, char *argv[]) {
ecs_world_t *world = ecs_init_w_args(argc, argv);
return ecs_fini(world);
}

View File

@@ -0,0 +1,16 @@
#ifndef SYSTEM_H
#define SYSTEM_H
/* This generated file contains includes for project dependencies */
#include "system/bake_config.h"
#ifdef __cplusplus
extern "C" {
#endif
#ifdef __cplusplus
}
#endif
#endif

View File

@@ -0,0 +1,24 @@
/*
)
(.)
.|.
| |
_.--| |--._
.-'; ;`-'& ; `&.
\ & ; & &_/
|"""---...---"""|
\ | | | | | | | /
`---.|.|.|.---'
* This file is generated by bake.lang.c for your convenience. Headers of
* dependencies will automatically show up in this file. Include bake_config.h
* in your main project file. Do not edit! */
#ifndef SYSTEM_BAKE_CONFIG_H
#define SYSTEM_BAKE_CONFIG_H
/* Headers of public dependencies */
#include "../../deps/flecs.h"
#endif

View File

@@ -0,0 +1,14 @@
{
"id": "system",
"type": "application",
"value": {
"public": false,
"use": [
"flecs"
],
"standalone": true
},
"lang.c": {
"defines": ["FLECS_CUSTOM_BUILD", "FLECS_SYSTEM"]
}
}

View File

@@ -0,0 +1,40 @@
#include <system.h>
typedef struct {
int32_t x, y;
} Position, Velocity;
void Move(ecs_iter_t *it) {
Position *p = ecs_field(it, Position, 1);
Velocity *v = ecs_field(it, Velocity, 2);
for (int i = 0; i < it->count; i ++) {
p[i].x += v[i].x;
p[i].y += v[i].y;
}
}
int main(int argc, char *argv[]) {
ecs_world_t *world = ecs_init_w_args(argc, argv);
ECS_COMPONENT(world, Position);
ECS_COMPONENT(world, Velocity);
ecs_entity_t s = ecs_system_init(world, &(ecs_system_desc_t){
.query.filter.terms = {{ .id = ecs_id(Position) }, { .id = ecs_id(Velocity) }},
.callback = Move,
});
assert(s != 0);
ecs_entity_t e = ecs_new_id(world);
ecs_set(world, e, Position, {10, 20});
ecs_set(world, e, Velocity, {1, 2});
ecs_run(world, s, 0, 0);
const Position *p = ecs_get(world, e, Position);
assert(p->x == 11);
assert(p->y == 22);
return ecs_fini(world);
}

View File

@@ -0,0 +1,16 @@
#ifndef TIMER_H
#define TIMER_H
/* This generated file contains includes for project dependencies */
#include "timer/bake_config.h"
#ifdef __cplusplus
extern "C" {
#endif
#ifdef __cplusplus
}
#endif
#endif

View File

@@ -0,0 +1,24 @@
/*
)
(.)
.|.
| |
_.--| |--._
.-'; ;`-'& ; `&.
\ & ; & &_/
|"""---...---"""|
\ | | | | | | | /
`---.|.|.|.---'
* This file is generated by bake.lang.c for your convenience. Headers of
* dependencies will automatically show up in this file. Include bake_config.h
* in your main project file. Do not edit! */
#ifndef TIMER_BAKE_CONFIG_H
#define TIMER_BAKE_CONFIG_H
/* Headers of public dependencies */
#include "../../deps/flecs.h"
#endif

View File

@@ -0,0 +1,14 @@
{
"id": "timer",
"type": "application",
"value": {
"public": false,
"use": [
"flecs"
],
"standalone": true
},
"lang.c": {
"defines": ["FLECS_CUSTOM_BUILD", "FLECS_TIMER"]
}
}

View File

@@ -0,0 +1,52 @@
#include <timer.h>
typedef struct {
int32_t x, y;
} Position, Velocity;
void Move(ecs_iter_t *it) {
Position *p = ecs_field(it, Position, 1);
Velocity *v = ecs_field(it, Velocity, 2);
for (int i = 0; i < it->count; i ++) {
p[i].x += v[i].x;
p[i].y += v[i].y;
}
}
int main(int argc, char *argv[]) {
ecs_world_t *world = ecs_init_w_args(argc, argv);
ECS_COMPONENT(world, Position);
ECS_COMPONENT(world, Velocity);
ecs_entity_t s = ecs_system_init(world, &(ecs_system_desc_t){
.query.filter.terms = {{ .id = ecs_id(Position) }, { .id = ecs_id(Velocity) }},
.callback = Move,
.entity = ecs_entity(world, {.add = {ecs_dependson(EcsOnUpdate)}}),
.interval = 2.9f
});
assert(s != 0);
EcsTimer *timer = ecs_get_mut(world, s, EcsTimer);
timer->time = 0;
ecs_entity_t e = ecs_new_id(world);
ecs_set(world, e, Position, {10, 20});
ecs_set(world, e, Velocity, {1, 2});
const Position *p = ecs_get(world, e, Position);
ecs_progress(world, 1.0);
ecs_progress(world, 1.0);
assert(p->x == 10);
assert(p->y == 20);
ecs_progress(world, 1.0);
assert(p->x == 11);
assert(p->y == 22);
return ecs_fini(world);
}

View File

@@ -0,0 +1,16 @@
#ifndef APP_H
#define APP_H
/* This generated file contains includes for project dependencies */
#include "app/bake_config.h"
#ifdef __cplusplus
extern "C" {
#endif
#ifdef __cplusplus
}
#endif
#endif

View File

@@ -0,0 +1,24 @@
/*
)
(.)
.|.
| |
_.--| |--._
.-'; ;`-'& ; `&.
\ & ; & &_/
|"""---...---"""|
\ | | | | | | | /
`---.|.|.|.---'
* This file is generated by bake.lang.c for your convenience. Headers of
* dependencies will automatically show up in this file. Include bake_config.h
* in your main project file. Do not edit! */
#ifndef APP_BAKE_CONFIG_H
#define APP_BAKE_CONFIG_H
/* Headers of public dependencies */
#include "../../deps/flecs.h"
#endif

View File

@@ -0,0 +1,15 @@
{
"id": "app",
"type": "application",
"value": {
"use": [
"flecs"
],
"public": false,
"standalone": true,
"language": "c++"
},
"lang.cpp": {
"defines": ["FLECS_CUSTOM_BUILD", "FLECS_CPP", "FLECS_APP"]
}
}

View File

@@ -0,0 +1,11 @@
#include <app.h>
int main(int, char *[]) {
flecs::world ecs;
ecs.system().iter([](flecs::iter& it) {
it.world().quit();
});
return ecs.app().run();
}

View File

@@ -0,0 +1,16 @@
#ifndef DLL_APP_H
#define DLL_APP_H
/* This generated file contains includes for project dependencies */
#include "dll_app/bake_config.h"
#ifdef __cplusplus
extern "C" {
#endif
#ifdef __cplusplus
}
#endif
#endif

View File

@@ -0,0 +1,25 @@
/*
)
(.)
.|.
| |
_.--| |--._
.-'; ;`-'& ; `&.
\ & ; & &_/
|"""---...---"""|
\ | | | | | | | /
`---.|.|.|.---'
* This file is generated by bake.lang.c for your convenience. Headers of
* dependencies will automatically show up in this file. Include bake_config.h
* in your main project file. Do not edit! */
#ifndef DLL_APP_BAKE_CONFIG_H
#define DLL_APP_BAKE_CONFIG_H
/* Headers of public dependencies */
#include <flecs.h>
#include <dll_module.h>
#endif

View File

@@ -0,0 +1,10 @@
{
"id": "dll_app",
"type": "application",
"value": {
"use": [
"flecs", "dll_module"
],
"language": "c++"
}
}

View File

@@ -0,0 +1,7 @@
#include <dll_app.h>
int main(int argc, char *argv[]) {
flecs::world world(argc, argv);
world.import<movement::module>();
}

View File

@@ -0,0 +1,33 @@
#ifndef DLL_MODULE_H
#define DLL_MODULE_H
/* This generated file contains includes for project dependencies */
#include "dll_module/bake_config.h"
#ifdef __cplusplus
extern "C" {
#endif
namespace movement
{
struct Position {
float x;
float y;
};
struct Velocity {
float x;
float y;
};
struct DLL_MODULE_API module {
module(flecs::world& world);
};
}
#ifdef __cplusplus
}
#endif
#endif

View File

@@ -0,0 +1,39 @@
/*
)
(.)
.|.
| |
_.--| |--._
.-'; ;`-'& ; `&.
\ & ; & &_/
|"""---...---"""|
\ | | | | | | | /
`---.|.|.|.---'
* This file is generated by bake.lang.c for your convenience. Headers of
* dependencies will automatically show up in this file. Include bake_config.h
* in your main project file. Do not edit! */
#ifndef DLL_MODULE_BAKE_CONFIG_H
#define DLL_MODULE_BAKE_CONFIG_H
/* Headers of public dependencies */
#include <flecs.h>
/* Convenience macro for exporting symbols */
#ifndef dll_module_STATIC
#if defined(dll_module_EXPORTS) && (defined(_MSC_VER) || defined(__MINGW32__))
#define DLL_MODULE_API __declspec(dllexport)
#elif defined(dll_module_EXPORTS)
#define DLL_MODULE_API __attribute__((__visibility__("default")))
#elif defined(_MSC_VER)
#define DLL_MODULE_API __declspec(dllimport)
#else
#define DLL_MODULE_API
#endif
#else
#define DLL_MODULE_API
#endif
#endif

View File

@@ -0,0 +1,10 @@
{
"id": "dll_module",
"type": "package",
"value": {
"use": [
"flecs"
],
"language": "c++"
}
}

View File

@@ -0,0 +1,11 @@
#include <dll_module.h>
namespace movement
{
module::module(flecs::world& ecs) {
ecs.module<module>();
ecs.component<Position>();
ecs.component<Velocity>();
}
}

View File

@@ -0,0 +1,16 @@
#ifndef DOC_H
#define DOC_H
/* This generated file contains includes for project dependencies */
#include "doc/bake_config.h"
#ifdef __cplusplus
extern "C" {
#endif
#ifdef __cplusplus
}
#endif
#endif

View File

@@ -0,0 +1,24 @@
/*
)
(.)
.|.
| |
_.--| |--._
.-'; ;`-'& ; `&.
\ & ; & &_/
|"""---...---"""|
\ | | | | | | | /
`---.|.|.|.---'
* This file is generated by bake.lang.c for your convenience. Headers of
* dependencies will automatically show up in this file. Include bake_config.h
* in your main project file. Do not edit! */
#ifndef DOC_BAKE_CONFIG_H
#define DOC_BAKE_CONFIG_H
/* Headers of public dependencies */
#include "../../deps/flecs.h"
#endif

View File

@@ -0,0 +1,15 @@
{
"id": "doc",
"type": "application",
"value": {
"use": [
"flecs"
],
"public": false,
"standalone": true,
"language": "c++"
},
"lang.cpp": {
"defines": ["FLECS_CUSTOM_BUILD", "FLECS_CPP", "FLECS_DOC"]
}
}

View File

@@ -0,0 +1,15 @@
#include <doc.h>
#include <iostream>
int main(int, char *[]) {
flecs::world world;
auto e = world.entity();
flecs::doc::set_brief(e, "brief");
flecs::doc::set_detail(e, "detail");
flecs::doc::set_link(e, "link");
assert(!strcmp(flecs::doc::get_brief(e), "brief"));
assert(!strcmp(flecs::doc::get_detail(e), "detail"));
assert(!strcmp(flecs::doc::get_link(e), "link"));
}

View File

@@ -0,0 +1,16 @@
#ifndef LOG_H
#define LOG_H
/* This generated file contains includes for project dependencies */
#include "log/bake_config.h"
#ifdef __cplusplus
extern "C" {
#endif
#ifdef __cplusplus
}
#endif
#endif

View File

@@ -0,0 +1,24 @@
/*
)
(.)
.|.
| |
_.--| |--._
.-'; ;`-'& ; `&.
\ & ; & &_/
|"""---...---"""|
\ | | | | | | | /
`---.|.|.|.---'
* This file is generated by bake.lang.c for your convenience. Headers of
* dependencies will automatically show up in this file. Include bake_config.h
* in your main project file. Do not edit! */
#ifndef LOG_BAKE_CONFIG_H
#define LOG_BAKE_CONFIG_H
/* Headers of public dependencies */
#include "../../deps/flecs.h"
#endif

View File

@@ -0,0 +1,15 @@
{
"id": "log",
"type": "application",
"value": {
"use": [
"flecs"
],
"public": false,
"standalone": true,
"language": "c++"
},
"lang.cpp": {
"defines": ["FLECS_CUSTOM_BUILD", "FLECS_CPP", "FLECS_LOG"]
}
}

View File

@@ -0,0 +1,6 @@
#include <log.h>
#include <iostream>
int main(int, char *[]) {
flecs::world world;
}

View File

@@ -0,0 +1,16 @@
#ifndef MODULE_H
#define MODULE_H
/* This generated file contains includes for project dependencies */
#include "module/bake_config.h"
#ifdef __cplusplus
extern "C" {
#endif
#ifdef __cplusplus
}
#endif
#endif

View File

@@ -0,0 +1,24 @@
/*
)
(.)
.|.
| |
_.--| |--._
.-'; ;`-'& ; `&.
\ & ; & &_/
|"""---...---"""|
\ | | | | | | | /
`---.|.|.|.---'
* This file is generated by bake.lang.c for your convenience. Headers of
* dependencies will automatically show up in this file. Include bake_config.h
* in your main project file. Do not edit! */
#ifndef MODULE_BAKE_CONFIG_H
#define MODULE_BAKE_CONFIG_H
/* Headers of public dependencies */
#include "../../deps/flecs.h"
#endif

View File

@@ -0,0 +1,15 @@
{
"id": "module",
"type": "application",
"value": {
"use": [
"flecs"
],
"public": false,
"standalone": true,
"language": "c++"
},
"lang.cpp": {
"defines": ["FLECS_CUSTOM_BUILD", "FLECS_CPP", "FLECS_MODULE"]
}
}

View File

@@ -0,0 +1,14 @@
#include <module.h>
#include <iostream>
struct my_module {
my_module(flecs::world& world) {
world.module<my_module>();
}
};
int main(int argc, char *argv[]) {
flecs::world world(argc, argv);
world.import<my_module>();
}

View File

@@ -0,0 +1,16 @@
#ifndef NO_ADDONS_H
#define NO_ADDONS_H
/* This generated file contains includes for project dependencies */
#include "no_addons/bake_config.h"
#ifdef __cplusplus
extern "C" {
#endif
#ifdef __cplusplus
}
#endif
#endif

View File

@@ -0,0 +1,24 @@
/*
)
(.)
.|.
| |
_.--| |--._
.-'; ;`-'& ; `&.
\ & ; & &_/
|"""---...---"""|
\ | | | | | | | /
`---.|.|.|.---'
* This file is generated by bake.lang.c for your convenience. Headers of
* dependencies will automatically show up in this file. Include bake_config.h
* in your main project file. Do not edit! */
#ifndef NO_ADDONS_BAKE_CONFIG_H
#define NO_ADDONS_BAKE_CONFIG_H
/* Headers of public dependencies */
#include "../../deps/flecs.h"
#endif

View File

@@ -0,0 +1,15 @@
{
"id": "no_addons",
"type": "application",
"value": {
"use": [
"flecs"
],
"public": false,
"standalone": true,
"language": "c++"
},
"lang.cpp": {
"defines": ["FLECS_CUSTOM_BUILD", "FLECS_CPP"]
}
}

View File

@@ -0,0 +1,6 @@
#include <no_addons.h>
#include <iostream>
int main(int, char *[]) {
flecs::world world;
}

View File

@@ -0,0 +1,16 @@
#ifndef PIPELINE_H
#define PIPELINE_H
/* This generated file contains includes for project dependencies */
#include "pipeline/bake_config.h"
#ifdef __cplusplus
extern "C" {
#endif
#ifdef __cplusplus
}
#endif
#endif

View File

@@ -0,0 +1,24 @@
/*
)
(.)
.|.
| |
_.--| |--._
.-'; ;`-'& ; `&.
\ & ; & &_/
|"""---...---"""|
\ | | | | | | | /
`---.|.|.|.---'
* This file is generated by bake.lang.c for your convenience. Headers of
* dependencies will automatically show up in this file. Include bake_config.h
* in your main project file. Do not edit! */
#ifndef PIPELINE_BAKE_CONFIG_H
#define PIPELINE_BAKE_CONFIG_H
/* Headers of public dependencies */
#include "../../deps/flecs.h"
#endif

View File

@@ -0,0 +1,15 @@
{
"id": "pipeline",
"type": "application",
"value": {
"use": [
"flecs"
],
"public": false,
"standalone": true,
"language": "c++"
},
"lang.cpp": {
"defines": ["FLECS_CUSTOM_BUILD", "FLECS_CPP", "FLECS_PIPELINE"]
}
}

Some files were not shown because too many files have changed in this diff Show More