diff options
author | Flávio J. Saraiva <flaviojs2005@gmail.com> | 2012-09-20 18:56:43 +0100 |
---|---|---|
committer | Flávio J. Saraiva <flaviojs2005@gmail.com> | 2012-09-26 17:01:15 +0100 |
commit | edd550e82d74184e239199479f913299862bd4c7 (patch) | |
tree | 6a8220bcda6aaec900192a294d2641547b6b480e | |
parent | 8cd5e176eb15fefe74a003b8f98999a172d94075 (diff) | |
download | lua-edd550e82d74184e239199479f913299862bd4c7.tar.gz |
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.
-rw-r--r-- | CMakeLists.txt | 3 |
1 files changed, 3 insertions, 0 deletions
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 ) |