From 2c25e2ae806e83230151c42b4eb8ab068e1311d2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Peter=20Drahos=CC=8C?= Date: Tue, 2 Oct 2012 17:50:42 +0200 Subject: LUA_BUILD_AS_DLL needs to affect only the liblua target --- CMakeLists.txt | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 8a0e107..86cba99 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -45,10 +45,7 @@ if ( WIN32 AND NOT CYGWIN ) option ( LUA_WIN "Windows specific build." ON ) option ( LUA_BUILD_WLUA "Build wLua interpretter without console output." ON ) option ( LUA_BUILD_AS_DLL "Build Lua library as Dll." ${BUILD_SHARED_LIBS} ) - if ( LUA_BUILD_AS_DLL ) - add_definitions ( -DLUA_BUILD_AS_DLL ) - endif () - + # Paths (Double escapes needed) set ( LUA_DIRSEP "\\\\" ) string ( REPLACE " /" ${LUA_DIRSEP} LUA_DIR "${LUA_DIR}" ) @@ -137,6 +134,9 @@ endif ( ) add_library ( liblua SHARED ${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 ( ) # Create static library, this is needed to compile luac in the 5.1.x Lua series add_library ( liblua_static STATIC ${SRC_LIB} ) -- cgit v1.2.1