diff --git a/_REPRO/crlf-script-loading/build-repro.sh b/_REPRO/crlf-script-loading/build-repro.sh new file mode 100755 index 0000000000..b6e4f25722 --- /dev/null +++ b/_REPRO/crlf-script-loading/build-repro.sh @@ -0,0 +1,5 @@ +#!/usr/bin/env bash +set -ex + +gcc-15 -c ../../distr/flecs.c -std=c99 -O2 -o flecs.o +g++-15 repro.cpp flecs.o -o repro -std=c++17 -lpthread diff --git a/_REPRO/crlf-script-loading/repro.cpp b/_REPRO/crlf-script-loading/repro.cpp new file mode 100644 index 0000000000..db22cb6f68 --- /dev/null +++ b/_REPRO/crlf-script-loading/repro.cpp @@ -0,0 +1,21 @@ +#include +#include "../../distr/flecs.h" + +int main(int argc, char* argv[]) { + if (argc < 2) { + std::cerr << "Usage: " << argv[0] << " " << std::endl; + return 1; + } + + flecs::world world; + + // Run the Flecs script file + if (world.script_run_file(argv[1]) != 0) { + std::cerr << "Error running script" << std::endl; + return 1; + } + + std::cout << "Script '" << argv[1] << "' executed successfully." << std::endl; + + return 0; +} diff --git a/_REPRO/crlf-script-loading/test.CRLF.flecs b/_REPRO/crlf-script-loading/test.CRLF.flecs new file mode 100644 index 0000000000..84efaf1b19 --- /dev/null +++ b/_REPRO/crlf-script-loading/test.CRLF.flecs @@ -0,0 +1,22 @@ +using flecs.meta + +struct MaxSpeed { + value = f32 +} + +struct Position { + x = f32 + y = f32 +} + +prefab SpaceShip { + MaxSpeed: {value: 100} + + cockpit { + Position: {x: -10, y: 0} + } +} + +my_spaceship : SpaceShip { + Position: {x: 10, y: 20} +} diff --git a/_REPRO/crlf-script-loading/test.LF.flecs b/_REPRO/crlf-script-loading/test.LF.flecs new file mode 100644 index 0000000000..84efaf1b19 --- /dev/null +++ b/_REPRO/crlf-script-loading/test.LF.flecs @@ -0,0 +1,22 @@ +using flecs.meta + +struct MaxSpeed { + value = f32 +} + +struct Position { + x = f32 + y = f32 +} + +prefab SpaceShip { + MaxSpeed: {value: 100} + + cockpit { + Position: {x: -10, y: 0} + } +} + +my_spaceship : SpaceShip { + Position: {x: 10, y: 20} +}