summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMattes D <github@xoft.cz>2014-06-14 15:47:37 +0200
committerMattes D <github@xoft.cz>2014-06-14 15:47:37 +0200
commitf1e3010839f2ccd26a6f71b93df08c9146464870 (patch)
tree65a8bba3141ec84b1a6325aa4407ba2593af38b3
parentFixed MSVC Bindings generation. (diff)
downloadcuberite-f1e3010839f2ccd26a6f71b93df08c9146464870.tar
cuberite-f1e3010839f2ccd26a6f71b93df08c9146464870.tar.gz
cuberite-f1e3010839f2ccd26a6f71b93df08c9146464870.tar.bz2
cuberite-f1e3010839f2ccd26a6f71b93df08c9146464870.tar.lz
cuberite-f1e3010839f2ccd26a6f71b93df08c9146464870.tar.xz
cuberite-f1e3010839f2ccd26a6f71b93df08c9146464870.tar.zst
cuberite-f1e3010839f2ccd26a6f71b93df08c9146464870.zip
-rw-r--r--src/Bindings/.gitignore1
-rw-r--r--src/Bindings/lua51.dllbin167424 -> 0 bytes
-rw-r--r--src/CMakeLists.txt37
3 files changed, 29 insertions, 9 deletions
diff --git a/src/Bindings/.gitignore b/src/Bindings/.gitignore
new file mode 100644
index 000000000..af8aa76fa
--- /dev/null
+++ b/src/Bindings/.gitignore
@@ -0,0 +1 @@
+lua51.dll
diff --git a/src/Bindings/lua51.dll b/src/Bindings/lua51.dll
deleted file mode 100644
index 515cf8b30..000000000
--- a/src/Bindings/lua51.dll
+++ /dev/null
Binary files differ
diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt
index f60a6d453..335ce8315 100644
--- a/src/CMakeLists.txt
+++ b/src/CMakeLists.txt
@@ -82,17 +82,36 @@ set(BINDING_DEPENDECIES
include_directories(Bindings)
include_directories(.)
-ADD_CUSTOM_COMMAND(
- # add any new generated bindings here
- OUTPUT ${CMAKE_CURRENT_SOURCE_DIR}/Bindings/Bindings.cpp ${CMAKE_CURRENT_SOURCE_DIR}/Bindings/Bindings.h
+if (WIN32)
+ ADD_CUSTOM_COMMAND(
+ # add any new generated bindings here
+ OUTPUT ${CMAKE_CURRENT_SOURCE_DIR}/Bindings/Bindings.cpp ${CMAKE_CURRENT_SOURCE_DIR}/Bindings/Bindings.h
- # command execuded to regerate bindings
- COMMAND tolua -L virtual_method_hooks.lua -o Bindings.cpp -H Bindings.h AllToLua.pkg
- WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}/Bindings/
+ # Copy the Lua DLL into the Bindings folder, so that tolua can run from there:
+ COMMAND copy /y ..\\..\\MCServer\\lua51.dll .
- # add any new generation dependencies here
- DEPENDS ${BINDING_DEPENDECIES}
-)
+ # Regenerate bindings:
+ COMMAND tolua -L virtual_method_hooks.lua -o Bindings.cpp -H Bindings.h AllToLua.pkg
+ WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}/Bindings/
+
+ # add any new generation dependencies here
+ DEPENDS ${BINDING_DEPENDECIES}
+ )
+else ()
+ ADD_CUSTOM_COMMAND(
+ # add any new generated bindings here
+ OUTPUT ${CMAKE_CURRENT_SOURCE_DIR}/Bindings/Bindings.cpp ${CMAKE_CURRENT_SOURCE_DIR}/Bindings/Bindings.h
+
+ # Regenerate bindings:
+ COMMAND tolua -L virtual_method_hooks.lua -o Bindings.cpp -H Bindings.h AllToLua.pkg
+ WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}/Bindings/
+
+ # add any new generation dependencies here
+ DEPENDS ${BINDING_DEPENDECIES}
+ )
+endif ()
+set_source_files_properties(Bindings/Bindings.cpp PROPERTIES GENERATED TRUE)
+set_source_files_properties(Bindings/Bindings.h PROPERTIES GENERATED TRUE)
if (NOT MSVC)