Skip to content

Commit 59da638

Browse files
committed
LUA_BUILD_AS_DLL needs to affect only the liblua target
1 parent 9964187 commit 59da638

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

CMakeLists.txt

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -40,9 +40,6 @@ if ( WIN32 AND NOT CYGWIN )
4040
# Windows systems
4141
option ( LUA_WIN "Windows specific build." ON )
4242
option ( LUA_BUILD_AS_DLL "Build Lua library as Dll." ${BUILD_SHARED_LIBS} )
43-
if ( LUA_BUILD_AS_DLL )
44-
add_definitions ( -DLUA_BUILD_AS_DLL )
45-
endif ()
4643

4744
# Paths (Double escapes ne option ( LUA_BUILD_AS_DLL "Build Lua library as Dll." ON )eded)
4845
set ( LUA_DIRSEP "\\\\" )
@@ -125,6 +122,9 @@ endif ( )
125122
add_library ( liblua SHARED ${SRC_CORE} ${SRC_LIB} ${LUA_DLL_RC} ${LUA_DEF} )
126123
target_link_libraries ( liblua ${LIBS} )
127124
set_target_properties ( liblua PROPERTIES OUTPUT_NAME lua CLEAN_DIRECT_OUTPUT 1 )
125+
if ( LUA_BUILD_AS_DLL )
126+
set_target_properties ( liblua PROPERTIES COMPILE_DEFINITIONS LUA_BUILD_AS_DLL )
127+
endif ()
128128

129129
add_executable ( lua ${SRC_LUA} src/lua.rc )
130130
target_link_libraries ( lua liblua )

0 commit comments

Comments
 (0)