From 52ec50010b6a340c9f9d1c3611cb14716086c3fc Mon Sep 17 00:00:00 2001 From: ThePhD Date: Sat, 23 Mar 2019 21:50:02 -0400 Subject: [PATCH] Update single, make sure warnings are not there. --- appveyor.yml | 2 +- cmake/Modules/FindLuaBuild/LuaJIT.cmake | 37 +++++++++++++++-- .../{compat-5.3.c => compat-5.3.c.h} | 0 include/sol/compatibility/compat-5.3.h | 2 +- include/sol/compatibility/version.hpp | 41 ++++++++++++------- include/sol/sol.hpp | 2 +- include/sol/stack_push.hpp | 1 - single/include/sol/forward.hpp | 4 +- single/include/sol/sol.hpp | 38 +++++++++-------- 9 files changed, 86 insertions(+), 41 deletions(-) rename include/sol/compatibility/{compat-5.3.c => compat-5.3.c.h} (100%) diff --git a/appveyor.yml b/appveyor.yml index 88a6ea4a..6aa3383b 100644 --- a/appveyor.yml +++ b/appveyor.yml @@ -126,7 +126,7 @@ init: - set parallelism= - set logger= - set build_compiler= -- set lua_build_type=OFF +- set lua_build_type=ON - set vcvars_script="C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\vcvarsall.bat" amd64 - if "%PLATFORM%"=="x64" (set arch= Win64) - if "%APPVEYOR_BUILD_WORKER_IMAGE%"=="Visual Studio 2017" (set CMAKE_GENERATOR=Visual Studio 15 2017%arch%&&set parallelism=/maxcpucount&&set logger=/verbosity:quiet /logger:"C:\Program Files\AppVeyor\BuildAgent\Appveyor.MSBuildLogger.dll"&&set vcvars_script="C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\VC\Auxiliary\Build\vcvars64.bat") diff --git a/cmake/Modules/FindLuaBuild/LuaJIT.cmake b/cmake/Modules/FindLuaBuild/LuaJIT.cmake index 0240fb43..920e5806 100644 --- a/cmake/Modules/FindLuaBuild/LuaJIT.cmake +++ b/cmake/Modules/FindLuaBuild/LuaJIT.cmake @@ -165,11 +165,40 @@ set(LUA_JIT_EXE_FILE "${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/${LUA_JIT_EXE_FILENAME}" if (MSVC) # Visual C++ is predicated off running msvcbuild.bat # which requires a Visual Studio Command Prompt - if (BUILD_LUA_AS_DLL) - set(LUA_JIT_MAKE_COMMAND cd src && msvcbuild.bat) - else() - set(LUA_JIT_MAKE_COMMAND cd src && msvcbuild.bat static) + # make sure to find the right one + find_file(VCVARS_ALL_BAT NAMES vcvarsall.bat + HINTS "C:/Program Files (x86)/Microsoft Visual Studio/2017/Community/VC/Auxiliary/Build" + "C:/Program Files (x86)/Microsoft Visual Studio/2017/Community/VC/Auxiliary" + "C:/Program Files (x86)/Microsoft Visual Studio/2017/Community/VC" + "C:/Program Files (x86)/Microsoft Visual Studio/2017/Professional/VC/Auxiliary/Build" + "C:/Program Files (x86)/Microsoft Visual Studio/2017/Professional/VC/Auxiliary" + "C:/Program Files (x86)/Microsoft Visual Studio/2017/Professional/VC" + "C:/Program Files (x86)/Microsoft Visual Studio/2017/Enterprise/VC/Auxiliary/Build" + "C:/Program Files (x86)/Microsoft Visual Studio/2017/Enterprise/VC/Auxiliary" + "C:/Program Files (x86)/Microsoft Visual Studio/2017/Enterprise/VC" + + "C:/Program Files/Microsoft Visual Studio/2017/Community/VC/Auxiliary/Build" + "C:/Program Files/Microsoft Visual Studio/2017/Community/VC/Auxiliary" + "C:/Program Files/Microsoft Visual Studio/2017/Community/VC" + "C:/Program Files/Microsoft Visual Studio/2017/Professional/VC/Auxiliary/Build" + "C:/Program Files/Microsoft Visual Studio/2017/Professional/VC/Auxiliary" + "C:/Program Files/Microsoft Visual Studio/2017/Professional/VC" + "C:/Program Files/Microsoft Visual Studio/2017/Enterprise/VC/Auxiliary/Build" + "C:/Program Files/Microsoft Visual Studio/2017/Enterprise/VC/Auxiliary" + "C:/Program Files/Microsoft Visual Studio/2017/Enterprise/VC") + if (VCVARS_ALL_BAT MATCHES "VCVARS_ALL_BAT-NOTFOUND") + MESSAGE(FATAL_ERROR "Cannot find 'vcvarsall.bat' file or similar needed to build LuaJIT ${LUA_VERSION} on Windows") endif() + if (CMAKE_SIZEOF_VOID_P LESS_EQUAL 4) + set(LUA_JIT_MAKE_COMMAND "${VCVARS_ALL_BAT}" x86) + else() + set(LUA_JIT_MAKE_COMMAND "${VCVARS_ALL_BAT}" x64) + endif() + set(LUA_JIT_MAKE_COMMAND ${LUA_JIT_MAKE_COMMAND} && cd src && msvcbuild.bat) + if (NOT BUILD_LUA_AS_DLL) + set(LUA_JIT_MAKE_COMMAND ${LUA_JIT_MAKE_COMMAND} static) + endif() + set(LUA_JIT_PREBUILT_LIB "lua51.lib") set(LUA_JIT_PREBUILT_IMP_LIB "lua51.lib") set(LUA_JIT_PREBUILT_DLL "lua51.dll") diff --git a/include/sol/compatibility/compat-5.3.c b/include/sol/compatibility/compat-5.3.c.h similarity index 100% rename from include/sol/compatibility/compat-5.3.c rename to include/sol/compatibility/compat-5.3.c.h diff --git a/include/sol/compatibility/compat-5.3.h b/include/sol/compatibility/compat-5.3.h index 1a71b102..d8cf806f 100644 --- a/include/sol/compatibility/compat-5.3.h +++ b/include/sol/compatibility/compat-5.3.h @@ -413,7 +413,7 @@ COMPAT53_API void luaL_requiref(lua_State *L, const char *modname, #if defined(COMPAT53_INCLUDE_SOURCE) && COMPAT53_INCLUDE_SOURCE == 1 -# include "compat-5.3.c" +# include "compat-5.3.c.h" #endif diff --git a/include/sol/compatibility/version.hpp b/include/sol/compatibility/version.hpp index 0eb6b5f7..718018ea 100644 --- a/include/sol/compatibility/version.hpp +++ b/include/sol/compatibility/version.hpp @@ -37,22 +37,33 @@ #define SOL_EXCEPTIONS_SAFE_PROPAGATION 1 #endif // Exceptions can be propagated safely using C++-compiled Lua #else - #if defined(__has_include) - #if __has_include() - #include - #else - extern "C" { - #include - #include - #include - #if defined(SOL_LUAJIT) && SOL_LUAJIT - #include - #endif - } - #endif // lua.hpp exists or does not + #if defined(SOL_NO_LUA_HPP) && SOL_NO_LUA_HPP + extern "C" { + #include + #include + #include + #if defined(LUAJIT_VERSION) && LUAJIT_VERSION + #include + #endif + } #else - #include - #endif // check for lua.hpp safely for Lua 5.1 derps + #if defined(__has_include) + #if __has_include() + #include + #else + extern "C" { + #include + #include + #include + #if defined(LUAJIT_VERSION) && LUAJIT_VERSION + #include + #endif + } + #endif // lua.hpp exists or does not + #else + #include + #endif // check for lua.hpp safely for Lua 5.1 derps + #endif // Manual - have lua.hpp or not #endif // C++ Mangling for Lua vs. Not #ifdef LUAJIT_VERSION diff --git a/include/sol/sol.hpp b/include/sol/sol.hpp index 70153dae..9dfe9415 100644 --- a/include/sol/sol.hpp +++ b/include/sol/sol.hpp @@ -66,7 +66,7 @@ #if defined(__GNUC__) #pragma GCC diagnostic pop #elif defined _MSC_VER -#pragma warning(push) +#pragma warning(pop) #endif // g++ #if defined(SOL_INSIDE_UNREAL) diff --git a/include/sol/stack_push.hpp b/include/sol/stack_push.hpp index ead491da..583ca954 100644 --- a/include/sol/stack_push.hpp +++ b/include/sol/stack_push.hpp @@ -90,7 +90,6 @@ namespace sol { #if SOL_LUA_VERSION < 502 // Use lua_getfenv lua_getfenv(L, index); - return 1; #else // Use upvalues as explained in Lua 5.2 and beyond's manual if (lua_getupvalue(L, index, 1) == nullptr) { diff --git a/single/include/sol/forward.hpp b/single/include/sol/forward.hpp index e1c81034..d9c39d06 100644 --- a/single/include/sol/forward.hpp +++ b/single/include/sol/forward.hpp @@ -20,8 +20,8 @@ // CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. // This file was generated with a script. -// Generated 2019-03-23 18:56:05.873126 UTC -// This header was generated with sol v3.0.1-beta (revision 9a0a27a) +// Generated 2019-03-24 01:49:03.673540 UTC +// This header was generated with sol v3.0.0-beta (revision 4aac17c) // https://github.com/ThePhD/sol2 #ifndef SOL_SINGLE_INCLUDE_FORWARD_HPP diff --git a/single/include/sol/sol.hpp b/single/include/sol/sol.hpp index 9c17dccf..f243b91e 100644 --- a/single/include/sol/sol.hpp +++ b/single/include/sol/sol.hpp @@ -20,8 +20,8 @@ // CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. // This file was generated with a script. -// Generated 2019-03-23 18:56:05.596914 UTC -// This header was generated with sol v3.0.1-beta (revision 9a0a27a) +// Generated 2019-03-24 01:49:03.378490 UTC +// This header was generated with sol v3.0.0-beta (revision 4aac17c) // https://github.com/ThePhD/sol2 #ifndef SOL_SINGLE_INCLUDE_HPP @@ -2072,17 +2072,24 @@ namespace sol { #define SOL_EXCEPTIONS_SAFE_PROPAGATION 1 #endif // Exceptions can be propagated safely using C++-compiled Lua #else - #if defined(__has_include) - #if __has_include() - #include - #else - extern "C" { - #if defined(SOL_LUAJIT) && SOL_LUAJIT - #endif - } - #endif // lua.hpp exists or does not + #if defined(SOL_NO_LUA_HPP) && SOL_NO_LUA_HPP + extern "C" { + #if defined(LUAJIT_VERSION) && LUAJIT_VERSION + #endif + } #else - #endif // check for lua.hpp safely for Lua 5.1 derps + #if defined(__has_include) + #if __has_include() + #include + #else + extern "C" { + #if defined(LUAJIT_VERSION) && LUAJIT_VERSION + #endif + } + #endif // lua.hpp exists or does not + #else + #endif // check for lua.hpp safely for Lua 5.1 derps + #endif // Manual - have lua.hpp or not #endif // C++ Mangling for Lua vs. Not #ifdef LUAJIT_VERSION @@ -2528,7 +2535,7 @@ COMPAT53_API void luaL_requiref(lua_State *L, const char *modname, #endif #if defined(COMPAT53_INCLUDE_SOURCE) && COMPAT53_INCLUDE_SOURCE == 1 -// beginning of sol/compatibility/compat-5.3.c +// beginning of sol/compatibility/compat-5.3.c.h #include #include @@ -3364,7 +3371,7 @@ COMPAT53_API void luaL_requiref(lua_State *L, const char *modname, * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. *********************************************************************/ -// end of sol/compatibility/compat-5.3.c +// end of sol/compatibility/compat-5.3.c.h #endif @@ -12673,7 +12680,6 @@ namespace sol { #if SOL_LUA_VERSION < 502 // Use lua_getfenv lua_getfenv(L, index); - return 1; #else // Use upvalues as explained in Lua 5.2 and beyond's manual if (lua_getupvalue(L, index, 1) == nullptr) { @@ -24964,7 +24970,7 @@ namespace sol { #if defined(__GNUC__) #pragma GCC diagnostic pop #elif defined _MSC_VER -#pragma warning(push) +#pragma warning(pop) #endif // g++ #if defined(SOL_INSIDE_UNREAL)