From edd550e82d74184e239199479f913299862bd4c7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fl=C3=A1vio=20J=2E=20Saraiva?= Date: Thu, 20 Sep 2012 18:56:43 +0100 Subject: Add missing LUA_BUILD_AS_DLL definition to the liblua target. Fixes lua.dll being generated without public symbols by the Visual Studio compiler; - when building a DLL you either need a DEF file listing the public symbols or use __declspec(export) in the public symbols. - when linking to a DLL you only need to use __declspec(import) when referencing data, since lua only exports functions it isn't needed for the other targets. --- CMakeLists.txt | 3 +++ 1 file changed, 3 insertions(+) diff --git a/CMakeLists.txt b/CMakeLists.txt index fef40e9..9e18e81 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -121,6 +121,9 @@ endif ( ) add_library ( liblua SHARED ${SRC_CORE} ${SRC_LIB} ${LUA_DLL_RC} ${LUA_DEF} ) target_link_libraries ( liblua ${LIBS} ) set_target_properties ( liblua PROPERTIES OUTPUT_NAME lua CLEAN_DIRECT_OUTPUT 1 ) +if ( LUA_BUILD_AS_DLL ) + set_target_properties ( liblua PROPERTIES COMPILE_DEFINITIONS LUA_BUILD_AS_DLL ) +endif ( ) add_executable ( lua ${SRC_LUA} src/lua.rc ) target_link_libraries ( lua liblua ) -- cgit v1.2.1