From 1da6c810e586f43ecb735e1ce83716ae744285d1 Mon Sep 17 00:00:00 2001
From: Joseph Walton-Rivers <joseph@walton-rivers.uk>
Date: Sun, 20 Nov 2022 20:14:37 +0000
Subject: [PATCH] add flags for disabling extention modules

---
 .gitlab-ci.yml |  4 ++--
 CMakeLists.txt | 12 ++++++++++--
 2 files changed, 12 insertions(+), 4 deletions(-)

diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml
index 337e071..9cadff4 100644
--- a/.gitlab-ci.yml
+++ b/.gitlab-ci.yml
@@ -36,7 +36,7 @@ build:fedora:
   extends: .f34-ogl
   stage: build
   script:
-    - cmake -S . -B build -DCMAKE_BUILD_TYPE=Debug
+    - cmake -S . -B build -DCMAKE_BUILD_TYPE=Debug -DFGGL_EXT_BULLET=OFF
     - cmake --build build
   artifacts:
     paths:
@@ -49,7 +49,7 @@ build:ubuntu:
     - apt update && apt install -y build-essential cmake
     - apt install -y libglm-dev libglfw3-dev libopenal-dev libspdlog-dev libfreetype-dev libyaml-cpp-dev libassimp-dev libbullet-extras-dev libgtest-dev libgmock-dev liblua5.2-dev
   script:
-    - cmake -S . -B build -DCMAKE_BUILD_TYPE=Debug
+    - cmake -S . -B build -DCMAKE_BUILD_TYPE=Debug -DFGGL_EXT_BULLET=OFF -DFGGL_EXT_LUA=OFF
     - cmake --build build
 
 
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 6e01950..5a9e2c4 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -8,6 +8,9 @@ option(FGGL_EXAMPLES "Should we build examples or just the library" ON)
 option(FGGL_TESTS "Should we enable the testing suite?" ON)
 option(FGGL_DOCS "Should we build documentation?" ON)
 
+option(FGGL_EXT_BULLET "Should we build the bullet module?" OFF)
+option(FGGL_EXT_LUA "Should we build the lua module?" ON)
+
 ##
 # Windows
 # When on windows, integrate vcpkg
@@ -66,8 +69,13 @@ endif()
 ##
 
 # 3rd party integrations
-add_subdirectory( integrations/bullet )
-add_subdirectory( integrations/lua )
+if ( FGGL_EXT_BULLET )
+	add_subdirectory( integrations/bullet )
+endif()
+
+if ( FGGL_EXT_LUA )
+	add_subdirectory( integrations/lua )
+endif()
 
 # Tools
 # add_subdirectory( tools/pack )
-- 
GitLab