Skip to content
Snippets Groups Projects
Commit 76a4caa5 authored by Joseph Walton-Rivers's avatar Joseph Walton-Rivers
Browse files

add checks for detecting if lua is supported to demo

parent 1da6c810
No related branches found
No related tags found
No related merge requests found
......@@ -40,7 +40,10 @@
#include "fggl/data/assimp/module.hpp"
#include "fggl/assets/module.hpp"
#include "fggl/assets/packed/module.hpp"
#include "fggl/script/lua/module.hpp"
#if __has_include("fggl/script/lua/module.hpp")
#include "fggl/script/lua/module.hpp"
#endif
#include "GameScene.h"
#include "rollball.hpp"
......@@ -85,7 +88,10 @@ int main(int argc, const char* argv[]) {
moduleManager.use<fggl::assets::AssetFolders>();
moduleManager.use<fggl::assets::PackedAssets>();
moduleManager.use<fggl::entity::ECS>();
moduleManager.use<fggl::script::Lua>();
#ifdef FGGL_HAS_LUA
moduleManager.use<fggl::script::Lua>();
#endif
// debug/testing use
moduleManager.use<fggl::data::AssimpLoader>();
......
......@@ -81,9 +81,10 @@ namespace demo {
m_phys = physService->create(&world(), entFactory);
auto* scriptProvider = m_owner.service<fggl::script::ScriptProvider>();
m_scripts = scriptProvider->create();
m_scripts->setGlobal("state", this);
if ( scriptProvider != nullptr ) {
m_scripts = scriptProvider->create();
m_scripts->setGlobal("state", this);
}
// asset loader
auto* assetLoader = m_owner.service<fggl::assets::Loader>();
......
......@@ -19,6 +19,8 @@
#ifndef FGGL_INTEGRATIONS_LUA_SCRIPT_LUA_MODULE_HPP
#define FGGL_INTEGRATIONS_LUA_SCRIPT_LUA_MODULE_HPP
#define FGGL_HAS_LUA
#include "fggl/modules/module.hpp"
#include "fggl/entity/module.hpp"
#include "fggl/script/engine.hpp"
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment