1
0

CMake: Lua DLL is built in the correct folder.

Also removed SCL warnings from MSVC builds.
This commit is contained in:
madmaxoft 2014-01-13 10:59:37 +01:00
parent 118b7a121b
commit caea934d37

View File

@ -21,6 +21,16 @@ endif()
# Lua needs to be linked dynamically on Windows and statically on *nix, so that LuaRocks work
if (WIN32)
add_library(lua SHARED ${SOURCE})
set(LIBRARY_OUTPUT_PATH ${CMAKE_SOURCE_DIR}/MCServer)
if (MSVC)
# MSVC generator adds a "Debug" or "Release" postfixes to the LIBRARY_OUTPUT_PATH, we need to cancel them:
SET_TARGET_PROPERTIES(lua PROPERTIES PREFIX "../")
SET_TARGET_PROPERTIES(lua PROPERTIES IMPORT_PREFIX "../")
SET_TARGET_PROPERTIES(
lua PROPERTIES COMPILE_FLAGS "-D_CRT_SECURE_NO_WARNINGS"
)
endif()
else()
add_library(lua ${SOURCE})
endif()
@ -33,3 +43,4 @@ endif()
if (UNIX)
target_link_libraries(lua m ${DYNAMIC_LOADER})
endif()