summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPeter Drahoš <drahosp@gmail.com>2012-10-02 17:50:42 +0200
committerPeter Drahoš <drahosp@gmail.com>2012-10-02 17:50:42 +0200
commit2c25e2ae806e83230151c42b4eb8ab068e1311d2 (patch)
tree79bade10d5e1ac03bcc77ecd2d3092e90bf0c607
parentbf6079136abfacb7ef14b14b3fa0bd0d9e873c3c (diff)
downloadlua-2c25e2ae806e83230151c42b4eb8ab068e1311d2.tar.gz
LUA_BUILD_AS_DLL needs to affect only the liblua target
-rw-r--r--CMakeLists.txt8
1 files 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} )