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 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"]
}
}

View File

@@ -0,0 +1,30 @@
#include <pipeline.h>
#include <iostream>
struct Position {
int32_t x, y;
};
struct Velocity {
int32_t x, y;
};
int main(int, char *[]) {
flecs::world ecs;
ecs.system<Position, const Velocity>()
.each([](Position& p, const Velocity& v) {
p.x += v.x;
p.y += v.y;
});
auto e = ecs.entity()
.set<Position>({10, 20})
.set<Velocity>({1, 2});
ecs.progress();
const Position *p = e.get<Position>();
assert(p->x == 11);
assert(p->y == 22);
}

View File

@@ -0,0 +1,16 @@
#ifndef PIPELINE_NO_TIMER_H
#define PIPELINE_NO_TIMER_H
/* This generated file contains includes for project dependencies */
#include "pipeline_no_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 PIPELINE_NO_TIMER_BAKE_CONFIG_H
#define PIPELINE_NO_TIMER_BAKE_CONFIG_H
/* Headers of public dependencies */
#include "../../deps/flecs.h"
#endif

View File

@@ -0,0 +1,25 @@
{
"id": "pipeline_no_timer",
"type": "application",
"value": {
"use": [
"flecs"
],
"public": false,
"standalone": true,
"language": "c++"
},
"lang.cpp": {
"defines": [
"FLECS_CUSTOM_BUILD",
"FLECS_STATS",
"FLECS_CPP",
"FLECS_MODULE",
"FLECS_SYSTEM",
"FLECS_PIPELINE",
"FLECS_EXPR",
"FLECS_PARSER",
"FLECS_LOG"
]
}
}

View File

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

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,15 @@
{
"id": "rest",
"type": "application",
"value": {
"use": [
"flecs"
],
"public": false,
"standalone": true,
"language": "c++"
},
"lang.cpp": {
"defines": ["FLECS_CUSTOM_BUILD", "FLECS_CPP", "FLECS_REST"]
}
}

View File

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

View File

@@ -0,0 +1,16 @@
#ifndef SNAPSHOT_H
#define SNAPSHOT_H
/* This generated file contains includes for project dependencies */
#include "snapshot/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 SNAPSHOT_BAKE_CONFIG_H
#define SNAPSHOT_BAKE_CONFIG_H
/* Headers of public dependencies */
#include "../../deps/flecs.h"
#endif

View File

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

View File

@@ -0,0 +1,10 @@
#include <snapshot.h>
#include <iostream>
int main(int, char *[]) {
flecs::world world;
auto s = world.snapshot();
s.restore();
}

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,15 @@
{
"id": "system",
"type": "application",
"value": {
"use": [
"flecs"
],
"public": false,
"standalone": true,
"language": "c++"
},
"lang.cpp": {
"defines": ["FLECS_CUSTOM_BUILD", "FLECS_CPP", "FLECS_SYSTEM"]
}
}

View File

@@ -0,0 +1,29 @@
#include <system.h>
struct Position {
int32_t x, y;
};
struct Velocity {
int32_t x, y;
};
int main(int, char *[]) {
flecs::world ecs;
auto s = ecs.system<Position, const Velocity>()
.each([](Position& p, const Velocity& v) {
p.x += v.x;
p.y += v.y;
});
auto e = ecs.entity()
.set<Position>({10, 20})
.set<Velocity>({1, 2});
s.run();
const Position *p = e.get<Position>();
assert(p->x == 11);
assert(p->y == 22);
}

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,15 @@
{
"id": "timer",
"type": "application",
"value": {
"use": [
"flecs"
],
"public": false,
"standalone": true,
"language": "c++"
},
"lang.cpp": {
"defines": ["FLECS_CUSTOM_BUILD", "FLECS_CPP", "FLECS_TIMER"]
}
}

View File

@@ -0,0 +1,41 @@
#include <timer.h>
#include <iostream>
struct Position {
int32_t x, y;
};
struct Velocity {
int32_t x, y;
};
int main(int, char *[]) {
flecs::world ecs;
flecs::entity s = ecs.system<Position, const Velocity>()
.interval(2.9f)
.each([](Position& p, const Velocity& v) {
p.x += v.x;
p.y += v.y;
});
flecs::Timer *t = s.get_mut<flecs::Timer>();
t->time = 0;
auto e = ecs.entity()
.set<Position>({10, 20})
.set<Velocity>({1, 2});
const Position *p = e.get<Position>();
ecs.progress(1.0);
ecs.progress(1.0);
assert(p->x == 10);
assert(p->y == 20);
ecs.progress(1.0);
assert(p->x == 11);
assert(p->y == 22);
}