Skip to content

Commit 68b4a2f

Browse files
committed
[update] cmake configuration to hide lamscripten behind a feature flag.
1 parent d716bee commit 68b4a2f

File tree

1 file changed

+21
-8
lines changed

1 file changed

+21
-8
lines changed

CMakeLists.txt

+21-8
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,15 @@ option(
2424
"Build the tests for lamscript. (Must be building as a library)"
2525
ON)
2626

27+
option(
28+
LAMSCRIPT_ENABLE_EXPERIMENTATION
29+
"Enable experimentation features."
30+
OFF)
31+
32+
option(
33+
LAMSCRIPTEN_BUILD_EXECUTABLE
34+
"Build lamscripten. Requires LAMSCRIPT_INCLUDE_EXPERIMENTATION to be ON."
35+
ON)
2736
# -------------------------------- DEPENDENCIES --------------------------------
2837

2938
# SPDLog -- Utilized for fast logging output and control.
@@ -89,13 +98,17 @@ if (LAMSCRIPT_BUILD_TESTS)
8998
endif()
9099

91100

92-
# ------------------------------- LAMSCRIPTEN ----------------------------------
101+
# ----------------------------- EXPERIMENTATION --------------------------------
93102

94-
file(
95-
GLOB_RECURSE
96-
LAMSCRIPTEN_SRC
97-
${CMAKE_SOURCE_DIR}/src/Lamscripten/*.cpp
98-
${CMAKE_SOURCE_DIR}/src/Lamscripten/*.h)
103+
if (LAMSCRIPT_ENABLE_EXPERIMENTATION)
104+
if (LAMSCRIPTEN_BUILD_EXECUTABLE)
105+
file(
106+
GLOB_RECURSE
107+
LAMSCRIPTEN_SRC
108+
${CMAKE_SOURCE_DIR}/src/Lamscripten/*.cpp
109+
${CMAKE_SOURCE_DIR}/src/Lamscripten/*.h)
99110

100-
add_executable(lamscripten ${LAMSCRIPTEN_SRC})
101-
target_include_directories(lamscripten PUBLIC ${CMAKE_SOURCE_DIR}/src)
111+
add_executable(lamscripten ${LAMSCRIPTEN_SRC})
112+
target_include_directories(lamscripten PUBLIC ${CMAKE_SOURCE_DIR}/src)
113+
endif()
114+
endif()

0 commit comments

Comments
 (0)