diff --git a/.appveyor.yml b/.appveyor.yml index 8f67fe4..c6f6890 100644 --- a/.appveyor.yml +++ b/.appveyor.yml @@ -14,7 +14,6 @@ before_build: - |- %DEPENDS% mkdir %PREFIX%\include\SDL2 %DEPENDS% mkdir %PREFIX%\lib - %DEPENDS% mkdir c:\lua %DEPENDS% cd %TEMP% # SDL2 @@ -66,17 +65,6 @@ before_build: copy %PREFIX%\lib\SDL2.dll %APPVEYOR_BUILD_FOLDER% > nul copy %PREFIX%\lib\cmocka.dll %APPVEYOR_BUILD_FOLDER% > nul - # Lua - - |- - - ps: | - If (!(Test-Path -Path "c:\usr\lib\liblua53.a")) { - (New-Object Net.WebClient).DownloadFile("https://sourceforge.net/projects/luabinaries/files/5.3.4/Windows%20Libraries/Static/lua-5.3.4_Win32_mingw4_lib.zip/download", "c:\lua\lua-5.3.4_Win32_mingw4_lib.zip") - } - - |- - %DEPENDS% 7z x "c:\lua\lua-5.3.4_Win32_mingw4_lib.zip" -o"c:\lua" > nul - %DEPENDS% copy c:\lua\include\*.h %PREFIX%\include > nul - %DEPENDS% copy c:\lua\liblua53.a %PREFIX%\lib > nul - build_script: - |- set Path=C:\MinGW\bin;%Path% diff --git a/.travis.yml b/.travis.yml index 5f2d39b..bd7f00b 100644 --- a/.travis.yml +++ b/.travis.yml @@ -32,7 +32,6 @@ install: - if [[ "$TRAVIS_OS_NAME" == "linux" ]]; then cmake .. && make -j2 && sudo make install ; fi - if [[ "$TRAVIS_OS_NAME" == "linux" ]]; then cd ../.. ; fi - if [[ "$TRAVIS_OS_NAME" == "linux" ]]; then sudo apt-get install -y libsdl2-dev libsdl2-image-dev libsdl2-mixer-dev libsdl2-ttf-dev ; fi - - if [[ "$TRAVIS_OS_NAME" == "linux" ]]; then sudo apt-get install -y lua5.2 liblua5.2-dev ; fi script: - mkdir _build diff --git a/CMakeLists.txt b/CMakeLists.txt index 218ce9e..3de8e2f 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -10,7 +10,6 @@ set(breakhack_MINOR_VERSION 0) set(breakhack_PATCH_VERSION 6) set(breakhack_RELEASE_TYPE "") -include(FindPhysFS) include(build/cmake/FindSDL2.cmake) include(build/cmake/FindSDL2_image.cmake) include(build/cmake/FindSDL2_ttf.cmake) @@ -89,20 +88,6 @@ IF ( GCC OR CLANG ) ) ENDIF ( GCC OR CLANG ) -if (NOT PHYSFS_FOUND OR WIN32) - set(PHYSFS_BUILD_STATIC TRUE) - set(PHYSFS_BUILD_SHARED FALSE) - set(PHYSFS_BUILD_TEST FALSE) - add_subdirectory(physfs-3.0.1) - include_directories( - physfs-3.0.1/src - ) -else () - include_directories( - ${PHYSFS_INCLUDE_DIR} - ) -endif () - if (STEAM) include_directories( ${STEAMWORKS_INCLUDE_DIR} @@ -111,7 +96,11 @@ if (STEAM) endif () add_subdirectory(lua-5.3.5) -include_directories(lua-5.3.5/src) +add_subdirectory(physfs-3.0.1) +include_directories( + lua-5.3.5/src + physfs-3.0.1/src + ) include_directories( ${PROJECT_BINARY_DIR} @@ -234,15 +223,9 @@ if (STEAM) ) endif () -if (NOT PHYSFS_FOUND) - target_link_libraries(breakhack - physfs-static - ) -else () - target_link_libraries(breakhack - ${PHYSFS_LIBRARY} - ) -endif () +target_link_libraries(breakhack + physfs-static + ) if (MSVC) set_target_properties(breakhack PROPERTIES LINK_FLAGS_DEBUG "/SUBSYSTEM:CONSOLE") diff --git a/lua-5.3.5/CMakeLists.txt b/lua-5.3.5/CMakeLists.txt index 42416b9..171fd0d 100644 --- a/lua-5.3.5/CMakeLists.txt +++ b/lua-5.3.5/CMakeLists.txt @@ -8,6 +8,10 @@ set(lua_MAJOR_VERSION 5) set(lua_MINOR_VERSION 3) set(lua_PATCH_VERSION 5) +if (NOT MSVC) + add_definitions(-DLUA_USE_POSIX) +endif () + add_library(lua STATIC src/lapi.c src/lauxlib.c diff --git a/physfs-3.0.1/CMakeLists.txt b/physfs-3.0.1/CMakeLists.txt index 9373a03..eb377d2 100644 --- a/physfs-3.0.1/CMakeLists.txt +++ b/physfs-3.0.1/CMakeLists.txt @@ -168,7 +168,7 @@ if(PHYSFS_BUILD_STATIC) set(PHYSFS_INSTALL_TARGETS ${PHYSFS_INSTALL_TARGETS} ";physfs-static") endif() -option(PHYSFS_BUILD_SHARED "Build shared library" TRUE) +option(PHYSFS_BUILD_SHARED "Build shared library" FALSE) if(PHYSFS_BUILD_SHARED) add_library(physfs SHARED ${PHYSFS_SRCS}) set_target_properties(physfs PROPERTIES MACOSX_RPATH 1) @@ -192,7 +192,7 @@ if(PHYSFS_BUILD_SHARED AND PHYSFS_BUILD_STATIC AND NOT WINDOWS) set_target_properties(physfs-static PROPERTIES CLEAN_DIRECT_OUTPUT 1) endif() -option(PHYSFS_BUILD_TEST "Build stdio test program." TRUE) +option(PHYSFS_BUILD_TEST "Build stdio test program." FALSE) mark_as_advanced(PHYSFS_BUILD_TEST) if(PHYSFS_BUILD_TEST) find_path(READLINE_H readline/readline.h) diff --git a/src/map_lua.c b/src/map_lua.c index cf3dc95..7cf4bf4 100644 --- a/src/map_lua.c +++ b/src/map_lua.c @@ -215,7 +215,9 @@ static Stats lua_checkstats(lua_State *L, int index) { // Confirm table - lua_istable(L, index); + if (lua_istable(L, index)) { + fatal("Bad table provided"); + } // Push to top of stack lua_pushvalue(L, index);