Merge pull request #1093 from mc-server/BindingsFix
Fixed MSVC Bindings generation.
This commit is contained in:
commit
c0bc4a9d3a
1
src/Bindings/.gitignore
vendored
Normal file
1
src/Bindings/.gitignore
vendored
Normal file
@ -0,0 +1 @@
|
||||
lua51.dll
|
Binary file not shown.
@ -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)
|
||||
|
||||
@ -157,6 +176,9 @@ else ()
|
||||
)
|
||||
source_group("" FILES ${SOURCE})
|
||||
|
||||
LIST(APPEND SOURCE "Bindings/Bindings.cpp" "Bindings/Bindings.h")
|
||||
source_group(Bindings FILES "Bindings/Bindings.cpp" "Bindings/Bindings.h")
|
||||
|
||||
# Add all subfolders as solution-folders:
|
||||
list(APPEND FOLDERS "Resources")
|
||||
list(APPEND FOLDERS "Bindings")
|
||||
|
Loading…
Reference in New Issue
Block a user