Skip to content
This repository was archived by the owner on Nov 20, 2020. It is now read-only.

Commit 2c25e2a

Browse files
committed
LUA_BUILD_AS_DLL needs to affect only the liblua target
1 parent bf60791 commit 2c25e2a

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

CMakeLists.txt

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -45,10 +45,7 @@ if ( WIN32 AND NOT CYGWIN )
4545
option ( LUA_WIN "Windows specific build." ON )
4646
option ( LUA_BUILD_WLUA "Build wLua interpretter without console output." ON )
4747
option ( LUA_BUILD_AS_DLL "Build Lua library as Dll." ${BUILD_SHARED_LIBS} )
48-
if ( LUA_BUILD_AS_DLL )
49-
add_definitions ( -DLUA_BUILD_AS_DLL )
50-
endif ()
51-
48+
5249
# Paths (Double escapes needed)
5350
set ( LUA_DIRSEP "\\\\" )
5451
string ( REPLACE " /" ${LUA_DIRSEP} LUA_DIR "${LUA_DIR}" )
@@ -137,6 +134,9 @@ endif ( )
137134
add_library ( liblua SHARED ${SRC_LIB} ${LUA_DLL_RC} ${LUA_DEF} )
138135
target_link_libraries ( liblua ${LIBS} )
139136
set_target_properties ( liblua PROPERTIES OUTPUT_NAME lua CLEAN_DIRECT_OUTPUT 1 )
137+
if ( LUA_BUILD_AS_DLL )
138+
set_target_properties ( liblua PROPERTIES COMPILE_DEFINITIONS LUA_BUILD_AS_DLL )
139+
endif ( )
140140

141141
# Create static library, this is needed to compile luac in the 5.1.x Lua series
142142
add_library ( liblua_static STATIC ${SRC_LIB} )

0 commit comments

Comments
 (0)