# HG changeset patch # User Sebastien Jodogne # Date 1519121736 -3600 # Node ID 8437607835ef62fa2fef0ea5792307aa385ca5a8 # Parent 8cc3ca64a534dc8a161cb875835c094c21d485bb# Parent 1e2d5e14b3d31ed12f00cd82d64cc800cfcfa988 branch integration: lua_dll->default diff -r 8cc3ca64a534 -r 8437607835ef NEWS --- a/NEWS Mon Feb 19 16:55:05 2018 +0100 +++ b/NEWS Tue Feb 20 11:15:36 2018 +0100 @@ -12,6 +12,12 @@ * New URI: "/tools/create-media-extended" to generate a DICOMDIR archive from several resources, including additional type-3 tags +Lua +--- + +* New CMake option: "-DENABLE_LUA_MODULES=ON" to enable support for + loading external Lua modules if the Lua engine is statically linked + Maintenance ----------- diff -r 8cc3ca64a534 -r 8437607835ef Resources/CMake/LuaConfiguration.cmake --- a/Resources/CMake/LuaConfiguration.cmake Mon Feb 19 16:55:05 2018 +0100 +++ b/Resources/CMake/LuaConfiguration.cmake Tue Feb 20 11:15:36 2018 +0100 @@ -5,11 +5,29 @@ DownloadPackage(${LUA_MD5} ${LUA_URL} "${LUA_SOURCES_DIR}") - add_definitions( - #-DLUA_LIB=1 - #-Dluaall_c=1 - #-DLUA_COMPAT_ALL=1 # Compile a generic version of Lua - ) + if (ENABLE_LUA_MODULES) + if (${CMAKE_SYSTEM_NAME} STREQUAL "Linux" OR + ${CMAKE_SYSTEM_NAME} STREQUAL "kFreeBSD" OR + ${CMAKE_SYSTEM_NAME} STREQUAL "FreeBSD" OR + ${CMAKE_SYSTEM_NAME} STREQUAL "OpenBSD") + # Enable loading of shared libraries (for UNIX-like) + add_definitions(-DLUA_USE_DLOPEN=1) + + # Publish the functions of the Lua engine (that are built within + # the Orthanc binary) as global symbols, so that the external + # shared libraries can call them + set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -Wl,--export-dynamic") + + elseif(${CMAKE_SYSTEM_NAME} STREQUAL "Windows") + add_definitions(-DLUA_DL_DLL=1) # Enable loading of shared libraries (for Microsoft Windows) + + elseif (${CMAKE_SYSTEM_NAME} STREQUAL "Darwin") + add_definitions(-LUA_DL_DYLD=1) # Enable loading of shared libraries (for Apple OS X) + + else() + message(FATAL_ERROR "Support your platform here") + endif() + endif() include_directories( ${LUA_SOURCES_DIR}/src diff -r 8cc3ca64a534 -r 8437607835ef Resources/CMake/OrthancFrameworkParameters.cmake --- a/Resources/CMake/OrthancFrameworkParameters.cmake Mon Feb 19 16:55:05 2018 +0100 +++ b/Resources/CMake/OrthancFrameworkParameters.cmake Tue Feb 20 11:15:36 2018 +0100 @@ -34,6 +34,7 @@ set(ENABLE_PKCS11 OFF CACHE BOOL "Enable PKCS#11 for HTTPS client authentication using hardware security modules and smart cards") set(ENABLE_PROFILING OFF CACHE BOOL "Whether to enable the generation of profiling information with gprof") set(ENABLE_SSL ON CACHE BOOL "Include support for SSL") +set(ENABLE_LUA_MODULES OFF CACHE BOOL "Enable support for loading external Lua modules (only meaningful if using static version of the Lua engine)") # Parameters to fine-tune linking against system libraries set(USE_SYSTEM_BOOST ON CACHE BOOL "Use the system version of Boost")