summaryrefslogtreecommitdiff
path: root/plugins/CMakeLists.txt
diff options
context:
space:
mode:
authorAlexander Gavrilov2012-04-14 19:44:07 +0400
committerAlexander Gavrilov2012-04-14 19:44:07 +0400
commitcb49c92b99a5aab3f95c811a43fe4dadc1115b99 (patch)
treefe2a4bcfc0a11e5ef3e2cbfbc864e5b9e8aa9ceb /plugins/CMakeLists.txt
parent7a34a89f53071a8368ec5bd064accb10354b6d56 (diff)
downloaddfhack-cb49c92b99a5aab3f95c811a43fe4dadc1115b99.tar.gz
dfhack-cb49c92b99a5aab3f95c811a43fe4dadc1115b99.tar.bz2
dfhack-cb49c92b99a5aab3f95c811a43fe4dadc1115b99.tar.xz
Allow plugins to export functions to lua with safe reload support.
- To ensure reload safety functions have to be wrapped. Every call checks the loaded state and locks a mutex in Plugin. If the plugin is unloaded, calling its functions throws a lua error. Therefore, plugins may not create closures or export yieldable functions. - The set of function argument and return types supported by LuaWrapper is severely limited when compared to being compiled inside the main library. Currently supported types: numbers, bool, std::string, df::foo, df::foo*, std::vector<bool>, std::vector<df::foo*>. - To facilitate postponing initialization until after all plugins have been loaded, the core sends a SC_CORE_INITIALIZED event. - As an example, the burrows plugin now exports its functions.
Diffstat (limited to 'plugins/CMakeLists.txt')
-rw-r--r--plugins/CMakeLists.txt4
1 files changed, 4 insertions, 0 deletions
diff --git a/plugins/CMakeLists.txt b/plugins/CMakeLists.txt
index d30d2569..9d236fbe 100644
--- a/plugins/CMakeLists.txt
+++ b/plugins/CMakeLists.txt
@@ -35,6 +35,10 @@ if (BUILD_DWARFEXPORT)
add_subdirectory (dwarfexport)
endif()
+install(DIRECTORY lua/
+ DESTINATION ${DFHACK_LUA_DESTINATION}/plugins
+ FILES_MATCHING PATTERN "*.lua")
+
# Protobuf
FILE(GLOB PROJECT_PROTOS ${CMAKE_CURRENT_SOURCE_DIR}/proto/*.proto)