Properly link flecs library
This commit is contained in:
16
engine/libs/flecs/test/custom_builds/cpp/app/include/app.h
Normal file
16
engine/libs/flecs/test/custom_builds/cpp/app/include/app.h
Normal 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
|
||||
|
||||
@@ -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
|
||||
|
||||
15
engine/libs/flecs/test/custom_builds/cpp/app/project.json
Normal file
15
engine/libs/flecs/test/custom_builds/cpp/app/project.json
Normal 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"]
|
||||
}
|
||||
}
|
||||
11
engine/libs/flecs/test/custom_builds/cpp/app/src/main.cpp
Normal file
11
engine/libs/flecs/test/custom_builds/cpp/app/src/main.cpp
Normal 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();
|
||||
}
|
||||
@@ -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
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -0,0 +1,10 @@
|
||||
{
|
||||
"id": "dll_app",
|
||||
"type": "application",
|
||||
"value": {
|
||||
"use": [
|
||||
"flecs", "dll_module"
|
||||
],
|
||||
"language": "c++"
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,7 @@
|
||||
#include <dll_app.h>
|
||||
|
||||
int main(int argc, char *argv[]) {
|
||||
flecs::world world(argc, argv);
|
||||
|
||||
world.import<movement::module>();
|
||||
}
|
||||
@@ -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
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -0,0 +1,10 @@
|
||||
{
|
||||
"id": "dll_module",
|
||||
"type": "package",
|
||||
"value": {
|
||||
"use": [
|
||||
"flecs"
|
||||
],
|
||||
"language": "c++"
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,11 @@
|
||||
#include <dll_module.h>
|
||||
|
||||
namespace movement
|
||||
{
|
||||
module::module(flecs::world& ecs) {
|
||||
ecs.module<module>();
|
||||
|
||||
ecs.component<Position>();
|
||||
ecs.component<Velocity>();
|
||||
}
|
||||
}
|
||||
16
engine/libs/flecs/test/custom_builds/cpp/doc/include/doc.h
Normal file
16
engine/libs/flecs/test/custom_builds/cpp/doc/include/doc.h
Normal 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
|
||||
|
||||
@@ -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
|
||||
|
||||
15
engine/libs/flecs/test/custom_builds/cpp/doc/project.json
Normal file
15
engine/libs/flecs/test/custom_builds/cpp/doc/project.json
Normal 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"]
|
||||
}
|
||||
}
|
||||
15
engine/libs/flecs/test/custom_builds/cpp/doc/src/main.cpp
Normal file
15
engine/libs/flecs/test/custom_builds/cpp/doc/src/main.cpp
Normal 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"));
|
||||
}
|
||||
16
engine/libs/flecs/test/custom_builds/cpp/log/include/log.h
Normal file
16
engine/libs/flecs/test/custom_builds/cpp/log/include/log.h
Normal 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
|
||||
|
||||
@@ -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
|
||||
|
||||
15
engine/libs/flecs/test/custom_builds/cpp/log/project.json
Normal file
15
engine/libs/flecs/test/custom_builds/cpp/log/project.json
Normal 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"]
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,6 @@
|
||||
#include <log.h>
|
||||
#include <iostream>
|
||||
|
||||
int main(int, char *[]) {
|
||||
flecs::world world;
|
||||
}
|
||||
@@ -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
|
||||
|
||||
@@ -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
|
||||
|
||||
15
engine/libs/flecs/test/custom_builds/cpp/module/project.json
Normal file
15
engine/libs/flecs/test/custom_builds/cpp/module/project.json
Normal 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"]
|
||||
}
|
||||
}
|
||||
14
engine/libs/flecs/test/custom_builds/cpp/module/src/main.cpp
Normal file
14
engine/libs/flecs/test/custom_builds/cpp/module/src/main.cpp
Normal 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>();
|
||||
}
|
||||
@@ -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
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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"]
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,6 @@
|
||||
#include <no_addons.h>
|
||||
#include <iostream>
|
||||
|
||||
int main(int, char *[]) {
|
||||
flecs::world world;
|
||||
}
|
||||
@@ -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
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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"]
|
||||
}
|
||||
}
|
||||
@@ -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);
|
||||
}
|
||||
@@ -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
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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"
|
||||
]
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,7 @@
|
||||
#include <pipeline_no_timer.h>
|
||||
#include <iostream>
|
||||
|
||||
int main(int, char *[]) {
|
||||
flecs::world ecs;
|
||||
ecs.progress();
|
||||
}
|
||||
16
engine/libs/flecs/test/custom_builds/cpp/rest/include/rest.h
Normal file
16
engine/libs/flecs/test/custom_builds/cpp/rest/include/rest.h
Normal 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
|
||||
|
||||
@@ -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
|
||||
|
||||
15
engine/libs/flecs/test/custom_builds/cpp/rest/project.json
Normal file
15
engine/libs/flecs/test/custom_builds/cpp/rest/project.json
Normal 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"]
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,8 @@
|
||||
#include <rest.h>
|
||||
#include <iostream>
|
||||
|
||||
int main(int, char *[]) {
|
||||
flecs::world world;
|
||||
|
||||
world.set<flecs::Rest>({});
|
||||
}
|
||||
@@ -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
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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"]
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,10 @@
|
||||
#include <snapshot.h>
|
||||
#include <iostream>
|
||||
|
||||
int main(int, char *[]) {
|
||||
flecs::world world;
|
||||
|
||||
auto s = world.snapshot();
|
||||
|
||||
s.restore();
|
||||
}
|
||||
@@ -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
|
||||
|
||||
@@ -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
|
||||
|
||||
15
engine/libs/flecs/test/custom_builds/cpp/system/project.json
Normal file
15
engine/libs/flecs/test/custom_builds/cpp/system/project.json
Normal 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"]
|
||||
}
|
||||
}
|
||||
29
engine/libs/flecs/test/custom_builds/cpp/system/src/main.cpp
Normal file
29
engine/libs/flecs/test/custom_builds/cpp/system/src/main.cpp
Normal 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);
|
||||
}
|
||||
@@ -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
|
||||
|
||||
@@ -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
|
||||
|
||||
15
engine/libs/flecs/test/custom_builds/cpp/timer/project.json
Normal file
15
engine/libs/flecs/test/custom_builds/cpp/timer/project.json
Normal 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"]
|
||||
}
|
||||
}
|
||||
41
engine/libs/flecs/test/custom_builds/cpp/timer/src/main.cpp
Normal file
41
engine/libs/flecs/test/custom_builds/cpp/timer/src/main.cpp
Normal 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);
|
||||
}
|
||||
Reference in New Issue
Block a user