summaryrefslogtreecommitdiffhomepage
path: root/CMakeLists.txt
diff options
context:
space:
mode:
authorJo-Philipp Wich <jo@mein.io>2022-01-18 11:42:47 +0100
committerGitHub <noreply@github.com>2022-01-18 11:42:47 +0100
commit4015c2c1769989c20ea7234296eea02a16d1703d (patch)
tree4c57d279a8b54df10e6b194b586d3f6423d8e7cd /CMakeLists.txt
parent0e5b273c3d25d1dce3b469f3a6865f430554e730 (diff)
parent3578afee0ab77650cf6adf3987a6f653f9311e9b (diff)
Merge pull request #32 from jow-/precompile
Introduce ucode precompilation support
Diffstat (limited to 'CMakeLists.txt')
-rw-r--r--CMakeLists.txt8
1 files changed, 7 insertions, 1 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt
index e668751..0621d51 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -13,6 +13,12 @@ ADD_DEFINITIONS(-Wmissing-declarations -Wno-error=unused-variable -Wno-unused-pa
INCLUDE_DIRECTORIES(include)
+OPTION(COMPILE_SUPPORT "Support compilation from source" ON)
+
+IF(NOT COMPILE_SUPPORT)
+ ADD_DEFINITIONS(-DNO_COMPILE)
+ENDIF()
+
OPTION(FS_SUPPORT "Filesystem plugin support" ON)
OPTION(MATH_SUPPORT "Math plugin support" ON)
OPTION(UBUS_SUPPORT "Ubus plugin support" ON)
@@ -51,7 +57,7 @@ IF(JSONC_FOUND)
INCLUDE_DIRECTORIES(${JSONC_INCLUDE_DIRS})
ENDIF()
-SET(UCODE_SOURCES lexer.c lib.c vm.c chunk.c vallist.c compiler.c source.c types.c)
+SET(UCODE_SOURCES lexer.c lib.c vm.c chunk.c vallist.c compiler.c source.c types.c program.c)
ADD_LIBRARY(libucode SHARED ${UCODE_SOURCES})
SET(SOVERSION 0 CACHE STRING "Override ucode library version")
SET_TARGET_PROPERTIES(libucode PROPERTIES OUTPUT_NAME ucode SOVERSION ${SOVERSION})