From 94a63902a756535e5bcf09a2a681046cadb3a7a1 Mon Sep 17 00:00:00 2001 From: ThePhD Date: Thu, 1 Mar 2018 22:08:27 -0500 Subject: [PATCH] fix order of is_specialization_of, since mpark and arthur and friends convinced me of The One True Way add workaround for VC++ /std:c++17 and /std:c++latest bugs try to add MD/MDd flags, pray it works... update single --- CMakeLists.txt | 4 + examples/docs/simple_functions.cpp | 6 +- examples/docs/simple_structs.cpp | 10 +-- examples/require_dll_example/CMakeLists.txt | 9 +- single/sol/sol.hpp | 93 +++++++++++++-------- single/sol/sol_forward.hpp | 4 +- sol/call.hpp | 6 +- sol/function_types.hpp | 8 +- sol/proxy.hpp | 2 +- sol/simple_usertype_metatable.hpp | 2 +- sol/state_view.hpp | 8 +- sol/table_core.hpp | 4 +- sol/traits.hpp | 29 ++++--- sol/types.hpp | 6 +- sol/usertype_core.hpp | 24 +++++- tests/test_sol.hpp | 1 - 16 files changed, 129 insertions(+), 87 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 015896b8..e5c1057b 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -74,6 +74,10 @@ if (MSVC) add_definitions(/DUNICODE /D_UNICODE /D_CRT_SECURE_NO_WARNINGS /D_CRT_SECURE_NO_DEPRECATE) # Warning level, exceptions add_compile_options(/W4 /EHsc) + add_compile_options("$<$:/MDd>" + "$<$:/MD>" + "$<$:/MD>" + "$<$:/MD>") if (NOT CMAKE_CXX_COMPILER_ID MATCHES "Clang") add_compile_options(/MP) endif() diff --git a/examples/docs/simple_functions.cpp b/examples/docs/simple_functions.cpp index a298c273..9ef02c94 100644 --- a/examples/docs/simple_functions.cpp +++ b/examples/docs/simple_functions.cpp @@ -1,18 +1,18 @@ #define SOL_CHECK_ARGUMENTS 1 #include -#include +#include "../assert.hpp" int main() { sol::state lua; int x = 0; lua.set_function("beep", [&x]{ ++x; }); lua.script("beep()"); - assert(x == 1); + c_assert(x == 1); sol::function beep = lua["beep"]; beep(); - assert(x == 2); + c_assert(x == 2); return 0; } diff --git a/examples/docs/simple_structs.cpp b/examples/docs/simple_structs.cpp index a2dd5c0d..8016e78c 100644 --- a/examples/docs/simple_structs.cpp +++ b/examples/docs/simple_structs.cpp @@ -1,7 +1,7 @@ #define SOL_CHECK_ARGUMENTS 1 #include -#include +#include "../assert.hpp" struct vars { int boop = 0; @@ -23,10 +23,10 @@ int main() { vars& beep = lua["beep"]; int bopvalue = lua["bopvalue"]; - assert(beep.boop == 1); - assert(lua.get("beep").boop == 1); - assert(beep.bop() == 2); - assert(bopvalue == 2); + c_assert(beep.boop == 1); + c_assert(lua.get("beep").boop == 1); + c_assert(beep.bop() == 2); + c_assert(bopvalue == 2); return 0; } diff --git a/examples/require_dll_example/CMakeLists.txt b/examples/require_dll_example/CMakeLists.txt index 88001890..9a7c9e9a 100644 --- a/examples/require_dll_example/CMakeLists.txt +++ b/examples/require_dll_example/CMakeLists.txt @@ -65,14 +65,7 @@ function(make_require_from_dll_example target_lib is_single) target_link_libraries(${example_lib_name} PRIVATE ${LUA_LIBRARIES}) endif() else() - if (lua_lib_type MATCHES "STATIC") - target_link_libraries(${example_lib_name} PRIVATE ${LUA_LIBRARIES}) - set_target_properties(${example_lib_name} PROPERTIES - WINDOWS_EXPORT_ALL_SYMBOLS TRUE - LINK_FLAGS "/OPT:NOREF /WHOLEARCHIVE:lua-5.2.4.lib") - else() - target_link_libraries(${example_lib_name} PRIVATE ${LUA_LIBRARIES}) - endif() + target_link_libraries(${example_lib_name} PRIVATE ${LUA_LIBRARIES}) endif() if (IS_X86) target_compile_options(${example_lib_name} BEFORE PRIVATE -m32) diff --git a/single/sol/sol.hpp b/single/sol/sol.hpp index 2af46e48..a2e80f09 100644 --- a/single/sol/sol.hpp +++ b/single/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 2018-03-01 00:19:34.880908 UTC -// This header was generated with sol v2.19.4 (revision b46b106) +// Generated 2018-03-02 02:30:38.238868 UTC +// This header was generated with sol v2.19.4 (revision 9bddce6) // https://github.com/ThePhD/sol2 #ifndef SOL_SINGLE_INCLUDE_HPP @@ -1177,10 +1177,15 @@ namespace sol { template using remove_member_pointer_t = remove_member_pointer; - template