1
0

bindings regenration logic

This commit is contained in:
Tycho Bickerstaff 2013-12-18 23:14:11 +00:00
parent 95ebc37faa
commit 0dbd55614b
7 changed files with 268 additions and 32350 deletions

View File

@ -11,6 +11,7 @@ add_subdirectory(lib/inifile/)
add_subdirectory(lib/jsoncpp/) add_subdirectory(lib/jsoncpp/)
add_subdirectory(lib/cryptopp/) add_subdirectory(lib/cryptopp/)
add_subdirectory(lib/zlib/) add_subdirectory(lib/zlib/)
add_subdirectory(lib/lua/)
#TODo: set -Wall -Werror -Wextra #TODo: set -Wall -Werror -Wextra
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS_BAK}") set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS_BAK}")

29
lib/lua/CMakeLists.txt Normal file
View File

@ -0,0 +1,29 @@
cmake_minimum_required (VERSION 2.6)
project (lua)
include_directories ("${PROJECT_SOURCE_DIR}/../../src/")
file(GLOB SOURCE
"*.c"
)
list(REMOVE_ITEM SOURCE "${PROJECT_SOURCE_DIR}/lua.c")
if ((${CMAKE_GENERATOR} MATCHES "Unix Makefiles") AND (NOT LUA_CMAKE_BUILD))
if(NOT ${PROJECT_SOURCE_DIR} MATCHES ${PROJECT_BINARY_DIR})
message(WARNING "lua does not support prefix when using the makefile")
endif()
ADD_CUSTOM_COMMAND(
OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/lua
COMMAND "make"
DEPENDS ${SOURCE}
)
else()
message("generator [${CMAKE_GENERATOR}] does not match Unix Makefiles so manually compiling lua")
add_library(lua ${SOURCE})
endif()

View File

@ -1,128 +1,119 @@
# makefile for installing Lua # CMAKE generated file: DO NOT EDIT!
# see INSTALL for installation instructions # Generated by "Unix Makefiles" Generator, CMake Version 2.8
# see src/Makefile and src/luaconf.h for further customization
# == CHANGE THE SETTINGS BELOW TO SUIT YOUR ENVIRONMENT ======================= # Default target executed when no arguments are given to make.
default_target: all
.PHONY : default_target
# Your platform. See PLATS for possible values. #=============================================================================
PLAT= none # Special targets provided by cmake.
# Where to install. The installation starts in the src and doc directories, # Disable implicit rules so canonical targets will work.
# so take care if INSTALL_TOP is not an absolute path. .SUFFIXES:
INSTALL_TOP= /usr/local
INSTALL_BIN= $(INSTALL_TOP)/bin
INSTALL_INC= $(INSTALL_TOP)/include
INSTALL_LIB= $(INSTALL_TOP)/lib
INSTALL_MAN= $(INSTALL_TOP)/man/man1
#
# You probably want to make INSTALL_LMOD and INSTALL_CMOD consistent with
# LUA_ROOT, LUA_LDIR, and LUA_CDIR in luaconf.h (and also with etc/lua.pc).
INSTALL_LMOD= $(INSTALL_TOP)/share/lua/$V
INSTALL_CMOD= $(INSTALL_TOP)/lib/lua/$V
# How to install. If your install program does not support "-p", then you # Remove some rules from gmake that .SUFFIXES does not remove.
# may have to run ranlib on the installed liblua.a (do "make ranlib"). SUFFIXES =
INSTALL= install -p
INSTALL_EXEC= $(INSTALL) -m 0755
INSTALL_DATA= $(INSTALL) -m 0644
#
# If you don't have install you can use cp instead.
# INSTALL= cp -p
# INSTALL_EXEC= $(INSTALL)
# INSTALL_DATA= $(INSTALL)
# Utilities. .SUFFIXES: .hpux_make_needs_suffix_list
MKDIR= mkdir -p
RANLIB= ranlib
# == END OF USER SETTINGS. NO NEED TO CHANGE ANYTHING BELOW THIS LINE ========= # Suppress display of executed commands.
$(VERBOSE).SILENT:
# Convenience platforms targets. # A target that is always out of date.
PLATS= aix ansi bsd freebsd generic linux macosx mingw posix solaris cmake_force:
.PHONY : cmake_force
# What to install. #=============================================================================
TO_BIN= lua luac # Set environment variables for the build.
TO_INC= lua.h luaconf.h lualib.h lauxlib.h ../etc/lua.hpp
TO_LIB= liblua.a
TO_MAN= lua.1 luac.1
# Lua version and release. # The shell in which to execute make rules.
V= 5.1 SHELL = /bin/sh
R= 5.1.4
all: $(PLAT) # The CMake executable.
CMAKE_COMMAND = /usr/bin/cmake
$(PLATS) clean: # The command to remove a file.
cd src && $(MAKE) $@ RM = /usr/bin/cmake -E remove -f
test: dummy # The top-level source directory on which CMake was run.
src/lua test/hello.lua CMAKE_SOURCE_DIR = /home/tycho/MCServer
install: dummy # The top-level build directory on which CMake was run.
cd src && $(MKDIR) $(INSTALL_BIN) $(INSTALL_INC) $(INSTALL_LIB) $(INSTALL_MAN) $(INSTALL_LMOD) $(INSTALL_CMOD) CMAKE_BINARY_DIR = /home/tycho/MCServer
cd src && $(INSTALL_EXEC) $(TO_BIN) $(INSTALL_BIN)
cd src && $(INSTALL_DATA) $(TO_INC) $(INSTALL_INC)
cd src && $(INSTALL_DATA) $(TO_LIB) $(INSTALL_LIB)
cd doc && $(INSTALL_DATA) $(TO_MAN) $(INSTALL_MAN)
ranlib: #=============================================================================
cd src && cd $(INSTALL_LIB) && $(RANLIB) $(TO_LIB) # Targets provided globally by CMake.
local: # Special rule for the target edit_cache
$(MAKE) install INSTALL_TOP=.. edit_cache:
@$(CMAKE_COMMAND) -E cmake_echo_color --switch=$(COLOR) --cyan "Running interactive CMake command-line interface..."
/usr/bin/cmake -i .
.PHONY : edit_cache
none: # Special rule for the target edit_cache
@echo "Please do" edit_cache/fast: edit_cache
@echo " make PLATFORM" .PHONY : edit_cache/fast
@echo "where PLATFORM is one of these:"
@echo " $(PLATS)"
@echo "See INSTALL for complete instructions."
# make may get confused with test/ and INSTALL in a case-insensitive OS # Special rule for the target rebuild_cache
dummy: rebuild_cache:
@$(CMAKE_COMMAND) -E cmake_echo_color --switch=$(COLOR) --cyan "Running CMake to regenerate build system..."
/usr/bin/cmake -H$(CMAKE_SOURCE_DIR) -B$(CMAKE_BINARY_DIR)
.PHONY : rebuild_cache
# echo config parameters # Special rule for the target rebuild_cache
echo: rebuild_cache/fast: rebuild_cache
@echo "" .PHONY : rebuild_cache/fast
@echo "These are the parameters currently set in src/Makefile to build Lua $R:"
@echo ""
@cd src && $(MAKE) -s echo
@echo ""
@echo "These are the parameters currently set in Makefile to install Lua $R:"
@echo ""
@echo "PLAT = $(PLAT)"
@echo "INSTALL_TOP = $(INSTALL_TOP)"
@echo "INSTALL_BIN = $(INSTALL_BIN)"
@echo "INSTALL_INC = $(INSTALL_INC)"
@echo "INSTALL_LIB = $(INSTALL_LIB)"
@echo "INSTALL_MAN = $(INSTALL_MAN)"
@echo "INSTALL_LMOD = $(INSTALL_LMOD)"
@echo "INSTALL_CMOD = $(INSTALL_CMOD)"
@echo "INSTALL_EXEC = $(INSTALL_EXEC)"
@echo "INSTALL_DATA = $(INSTALL_DATA)"
@echo ""
@echo "See also src/luaconf.h ."
@echo ""
# echo private config parameters # The main all target
pecho: all: cmake_check_build_system
@echo "V = $(V)" cd /home/tycho/MCServer && $(CMAKE_COMMAND) -E cmake_progress_start /home/tycho/MCServer/CMakeFiles /home/tycho/MCServer/lib/lua/CMakeFiles/progress.marks
@echo "R = $(R)" cd /home/tycho/MCServer && $(MAKE) -f CMakeFiles/Makefile2 lib/lua/all
@echo "TO_BIN = $(TO_BIN)" $(CMAKE_COMMAND) -E cmake_progress_start /home/tycho/MCServer/CMakeFiles 0
@echo "TO_INC = $(TO_INC)" .PHONY : all
@echo "TO_LIB = $(TO_LIB)"
@echo "TO_MAN = $(TO_MAN)"
# echo config parameters as Lua code # The main clean target
# uncomment the last sed expression if you want nil instead of empty strings clean:
lecho: cd /home/tycho/MCServer && $(MAKE) -f CMakeFiles/Makefile2 lib/lua/clean
@echo "-- installation parameters for Lua $R" .PHONY : clean
@echo "VERSION = '$V'"
@echo "RELEASE = '$R'"
@$(MAKE) echo | grep = | sed -e 's/= /= "/' -e 's/$$/"/' #-e 's/""/nil/'
@echo "-- EOF"
# list targets that do not create files (but not all makes understand .PHONY) # The main clean target
.PHONY: all $(PLATS) clean test install local none dummy echo pecho lecho clean/fast: clean
.PHONY : clean/fast
# Prepare targets for installation.
preinstall: all
cd /home/tycho/MCServer && $(MAKE) -f CMakeFiles/Makefile2 lib/lua/preinstall
.PHONY : preinstall
# Prepare targets for installation.
preinstall/fast:
cd /home/tycho/MCServer && $(MAKE) -f CMakeFiles/Makefile2 lib/lua/preinstall
.PHONY : preinstall/fast
# clear depends
depend:
cd /home/tycho/MCServer && $(CMAKE_COMMAND) -H$(CMAKE_SOURCE_DIR) -B$(CMAKE_BINARY_DIR) --check-build-system CMakeFiles/Makefile.cmake 1
.PHONY : depend
# Help Target
help:
@echo "The following are some of the valid targets for this Makefile:"
@echo "... all (the default if no target is provided)"
@echo "... clean"
@echo "... depend"
@echo "... edit_cache"
@echo "... rebuild_cache"
.PHONY : help
#=============================================================================
# Special targets to cleanup operation of make.
# Special rule to run CMake to check the build system integrity.
# No rule that depends on this can have commands that come from listfiles
# because they might be regenerated.
cmake_check_build_system:
cd /home/tycho/MCServer && $(CMAKE_COMMAND) -H$(CMAKE_SOURCE_DIR) -B$(CMAKE_BINARY_DIR) --check-build-system CMakeFiles/Makefile.cmake 0
.PHONY : cmake_check_build_system
# (end of Makefile)

View File

@ -1,5 +1,134 @@
# makefile for tolua hierarchy # CMAKE generated file: DO NOT EDIT!
# Generated by "Unix Makefiles" Generator, CMake Version 2.8
# Default target executed when no arguments are given to make.
default_target: all
.PHONY : default_target
#=============================================================================
# Special targets provided by cmake.
# Disable implicit rules so canonical targets will work.
.SUFFIXES:
# Remove some rules from gmake that .SUFFIXES does not remove.
SUFFIXES =
.SUFFIXES: .hpux_make_needs_suffix_list
# Suppress display of executed commands.
$(VERBOSE).SILENT:
# A target that is always out of date.
cmake_force:
.PHONY : cmake_force
#=============================================================================
# Set environment variables for the build.
# The shell in which to execute make rules.
SHELL = /bin/sh
# The CMake executable.
CMAKE_COMMAND = /usr/bin/cmake
# The command to remove a file.
RM = /usr/bin/cmake -E remove -f
# The top-level source directory on which CMake was run.
CMAKE_SOURCE_DIR = /home/tycho/MCServer
# The top-level build directory on which CMake was run.
CMAKE_BINARY_DIR = /home/tycho/MCServer
#=============================================================================
# Targets provided globally by CMake.
# Special rule for the target edit_cache
edit_cache:
@$(CMAKE_COMMAND) -E cmake_echo_color --switch=$(COLOR) --cyan "Running interactive CMake command-line interface..."
/usr/bin/cmake -i .
.PHONY : edit_cache
# Special rule for the target edit_cache
edit_cache/fast: edit_cache
.PHONY : edit_cache/fast
# Special rule for the target rebuild_cache
rebuild_cache:
@$(CMAKE_COMMAND) -E cmake_echo_color --switch=$(COLOR) --cyan "Running CMake to regenerate build system..."
/usr/bin/cmake -H$(CMAKE_SOURCE_DIR) -B$(CMAKE_BINARY_DIR)
.PHONY : rebuild_cache
# Special rule for the target rebuild_cache
rebuild_cache/fast: rebuild_cache
.PHONY : rebuild_cache/fast
# The main all target
all: cmake_check_build_system
cd /home/tycho/MCServer && $(CMAKE_COMMAND) -E cmake_progress_start /home/tycho/MCServer/CMakeFiles /home/tycho/MCServer/lib/tolua++/CMakeFiles/progress.marks
cd /home/tycho/MCServer && $(MAKE) -f CMakeFiles/Makefile2 lib/tolua++/all
$(CMAKE_COMMAND) -E cmake_progress_start /home/tycho/MCServer/CMakeFiles 0
.PHONY : all
# The main clean target
clean:
cd /home/tycho/MCServer && $(MAKE) -f CMakeFiles/Makefile2 lib/tolua++/clean
.PHONY : clean
# The main clean target
clean/fast: clean
.PHONY : clean/fast
# Prepare targets for installation.
preinstall: all
cd /home/tycho/MCServer && $(MAKE) -f CMakeFiles/Makefile2 lib/tolua++/preinstall
.PHONY : preinstall
# Prepare targets for installation.
preinstall/fast:
cd /home/tycho/MCServer && $(MAKE) -f CMakeFiles/Makefile2 lib/tolua++/preinstall
.PHONY : preinstall/fast
# clear depends
depend:
cd /home/tycho/MCServer && $(CMAKE_COMMAND) -H$(CMAKE_SOURCE_DIR) -B$(CMAKE_BINARY_DIR) --check-build-system CMakeFiles/Makefile.cmake 1
.PHONY : depend
# Convenience name for target.
lib/tolua++/CMakeFiles/tolua.dir/rule:
cd /home/tycho/MCServer && $(MAKE) -f CMakeFiles/Makefile2 lib/tolua++/CMakeFiles/tolua.dir/rule
.PHONY : lib/tolua++/CMakeFiles/tolua.dir/rule
# Convenience name for target.
tolua: lib/tolua++/CMakeFiles/tolua.dir/rule
.PHONY : tolua
# fast build rule for target.
tolua/fast:
cd /home/tycho/MCServer && $(MAKE) -f lib/tolua++/CMakeFiles/tolua.dir/build.make lib/tolua++/CMakeFiles/tolua.dir/build
.PHONY : tolua/fast
# Help Target
help:
@echo "The following are some of the valid targets for this Makefile:"
@echo "... all (the default if no target is provided)"
@echo "... clean"
@echo "... depend"
@echo "... edit_cache"
@echo "... rebuild_cache"
@echo "... tolua"
.PHONY : help
#=============================================================================
# Special targets to cleanup operation of make.
# Special rule to run CMake to check the build system integrity.
# No rule that depends on this can have commands that come from listfiles
# because they might be regenerated.
cmake_check_build_system:
cd /home/tycho/MCServer && $(CMAKE_COMMAND) -H$(CMAKE_SOURCE_DIR) -B$(CMAKE_BINARY_DIR) --check-build-system CMakeFiles/Makefile.cmake 0
.PHONY : cmake_check_build_system
all:
@echo "Makefile is deprecated ;)"
@echo "see INSTALL for details on how to build tolua++"

File diff suppressed because it is too large Load Diff

View File

@ -1,8 +0,0 @@
/*
** Lua binding: AllToLua
** Generated automatically by tolua++-1.0.92 on 12/18/13 16:09:11.
*/
/* Exported function */
TOLUA_API int tolua_AllToLua_open (lua_State* tolua_S);

View File

@ -4,13 +4,19 @@ project (MCServer)
include_directories ("${PROJECT_SOURCE_DIR}/../") include_directories ("${PROJECT_SOURCE_DIR}/../")
if (WIN32)
add_executable(tolua++.exe IMPORTED)
else ()
message(WARNING "cannot rebuild bindings when not on windows")
endif()
ADD_CUSTOM_COMMAND( ADD_CUSTOM_COMMAND(
#add any new generated bindings here #add any new generated bindings here
OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/Bindings.cpp ${CMAKE_CURRENT_BINARY_DIR}/Bindings.h OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/Bindings.cpp ${CMAKE_CURRENT_BINARY_DIR}/Bindings.h
#command execuded to regerate bindings #command execuded to regerate bindings
COMMAND "./tolua++.exe" -L virtual_method_hooks.lua -o Bindings.cpp -H Bindings.h AllToLua.pkg COMMAND "./tolua++.exe" -L virtual_method_hooks.lua -o Bindings.cpp -H Bindings.h AllToLua.pkg
#add any new generation dependencies here #add any new generation dependencies here
DEPENDS ${CMAKE_CURRENT_SOURCE_DIR}/virtual_method_hooks.lua ${CMAKE_CURRENT_SOURCE_DIR}/AllToLua.pkg DEPENDS ${CMAKE_CURRENT_SOURCE_DIR}/virtual_method_hooks.lua ${CMAKE_CURRENT_SOURCE_DIR}/AllToLua.pkg tolua++.exe
) )
add_library(Bindings PluginManager LuaState WebPlugin) add_library(Bindings PluginManager LuaState WebPlugin Bindings)