summaryrefslogtreecommitdiffstats
path: root/lib/lua/CMakeLists.txt
diff options
context:
space:
mode:
Diffstat (limited to 'lib/lua/CMakeLists.txt')
-rw-r--r--lib/lua/CMakeLists.txt11
1 files changed, 11 insertions, 0 deletions
diff --git a/lib/lua/CMakeLists.txt b/lib/lua/CMakeLists.txt
index af03f4b1a..4a77578dd 100644
--- a/lib/lua/CMakeLists.txt
+++ b/lib/lua/CMakeLists.txt
@@ -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()
+