diff --git a/.github/ISSUE_TEMPLATE.md b/.github/ISSUE_TEMPLATE.md index 4322ab05..dae6f601 100644 --- a/.github/ISSUE_TEMPLATE.md +++ b/.github/ISSUE_TEMPLATE.md @@ -1,4 +1,6 @@ -Read these guidelines. They are relatively simple and will allow me to help you better: +Read these guidelines. They are relatively simple and will allow me to help you better! + +For Error Reports: 1. Produce a simple, short, compilable test case that reproduces your problem. 2. Make a descriptive title that summarises the bug as a whole. @@ -11,4 +13,4 @@ If you want to request a feature: 2. Include a description and title of what you would like. 3. Annotate and describe the behavior through comments, asserts or just a small write up. -Thanks for helping sol grow! +Thanks for helping sol2 grow! diff --git a/CMakeLists.txt b/CMakeLists.txt index 09d2508d..ccdba811 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -213,8 +213,8 @@ if (SOL2_IS_TOP_LEVEL AND (SOL2_DO_TESTS OR SOL2_DO_EXAMPLES)) set(CMAKE_THREAD_PREFER_PTHREAD TRUE) set(THREADS_PREFER_PTHREAD_FLAG TRUE) else() - string(REGEX REPLACE "/W[0-4]" "" CMAKE_C_FLAGS ${CMAKE_C_FLAGS}) - string(REGEX REPLACE "/W[0-4]" "" CMAKE_CXX_FLAGS ${CMAKE_CXX_FLAGS}) + string(REGEX REPLACE "/W[0-4]" "/W4" CMAKE_C_FLAGS ${CMAKE_C_FLAGS}) + string(REGEX REPLACE "/W[0-4]" "/W4" CMAKE_CXX_FLAGS ${CMAKE_CXX_FLAGS}) if (BUILD_LUA_AS_DLL) string(REGEX REPLACE "/MT" "/MD" CMAKE_C_FLAGS ${CMAKE_C_FLAGS}) string(REGEX REPLACE "/MT" "/MD" CMAKE_CXX_FLAGS ${CMAKE_CXX_FLAGS}) diff --git a/docs/source/tutorial/getting-started.rst b/docs/source/tutorial/getting-started.rst index 8f19bf24..4ea3c433 100644 --- a/docs/source/tutorial/getting-started.rst +++ b/docs/source/tutorial/getting-started.rst @@ -12,6 +12,7 @@ After that, make sure you grab either the `single header file release`_, or just When you're ready, try compiling this short snippet: .. literalinclude:: ../../../examples/source/tutorials/first_snippet.cpp + :lines: 1-4, 8- :linenos: :caption: hello_lua.cpp :name: hello-lua @@ -31,6 +32,7 @@ If this works, you're ready to start! The first line creates the ``lua_State`` a The second line opens a single lua-provided library, "base". There are several other libraries that come with lua that you can open by default, and those are included in the :ref:`sol::lib` enumeration. You can open multiple base libraries by specifying multiple ``sol::lib`` arguments: .. literalinclude:: ../../../examples/source/tutorials/open_multiple_libraries.cpp + :lines: 1-4, 8- :linenos: :caption: multiple_libraries.cpp :name: open-multiple-libraries @@ -40,7 +42,7 @@ If you're interested in integrating sol with a project that already uses some ot .. note:: After you learn the basics of sol, it is usually advised that if you think something can work, you should TRY IT. It will probably work! - + Some more ways of loading scripts and handling errors is shown `in this example`_! There is also a full, cross-platform `example of loading a DLL`_. diff --git a/examples/source/dynamic_object.cpp b/examples/source/dynamic_object.cpp index 3d04da6d..795af238 100644 --- a/examples/source/dynamic_object.cpp +++ b/examples/source/dynamic_object.cpp @@ -2,6 +2,7 @@ #include #include +#include #include "assert.hpp" // use as-is, @@ -39,12 +40,12 @@ int main() { lua.open_libraries(sol::lib::base); lua.new_usertype("dynamic_object", - sol::meta_function::index, &dynamic_object::dynamic_get, - sol::meta_function::new_index, &dynamic_object::dynamic_set, - sol::meta_function::length, [](dynamic_object& d) { - return d.entries.size(); - } - ); + sol::meta_function::index, + &dynamic_object::dynamic_get, + sol::meta_function::new_index, + &dynamic_object::dynamic_set, + sol::meta_function::length, + [](dynamic_object& d) { return d.entries.size(); }); lua.safe_script(R"( d1 = dynamic_object.new() diff --git a/examples/source/metatable_customization.cpp b/examples/source/metatable_customization.cpp index c259598f..b5faee25 100644 --- a/examples/source/metatable_customization.cpp +++ b/examples/source/metatable_customization.cpp @@ -2,6 +2,7 @@ #include #include +#include struct thing { int member_variable = 5; @@ -21,11 +22,11 @@ static std::unordered_map thing_variable_associat void register_thing_type(sol::state& lua) { thing_variable_associations.emplace_hint(thing_variable_associations.cend(), - "member_variable", sol::object(lua.lua_state(), sol::in_place, &sol::c_call) - ); + "member_variable", + sol::object(lua.lua_state(), sol::in_place, &sol::c_call)); thing_function_associations.emplace_hint(thing_function_associations.cend(), - "member_function", sol::object(lua.lua_state(), sol::in_place, &sol::c_call) - ); + "member_function", + sol::object(lua.lua_state(), sol::in_place, &sol::c_call)); struct call_handler { static int lookup_function(lua_State* L) { @@ -55,7 +56,7 @@ void register_thing_type(sol::state& lua) { // so we call out lua_CFunction that we serialized earlier auto it = thing_variable_associations.find(*maybe_svkey); if (it != thing_variable_associations.cend()) { - // note that calls generated by sol3 + // note that calls generated by sol3 // for member variables expect the stack ordering to be // 2(, 3, ..., n) -- value(s) // 1 -- source @@ -87,7 +88,7 @@ void register_thing_type(sol::state& lua) { // so we call out lua_CFunction that we serialized earlier auto it = thing_variable_associations.find(*maybe_svkey); if (it != thing_variable_associations.cend()) { - // note that calls generated by sol3 + // note that calls generated by sol3 // for member variables expect the stack ordering to be // 2(, 3, ..., n) -- value(s) // 1 -- source diff --git a/examples/source/tutorials/first_snippet.cpp b/examples/source/tutorials/first_snippet.cpp index 018f9c60..5949a783 100644 --- a/examples/source/tutorials/first_snippet.cpp +++ b/examples/source/tutorials/first_snippet.cpp @@ -2,6 +2,9 @@ #include // or #include "sol.hpp", whichever suits your needs int main(int argc, char* argv[]) { + // silence unused warnings + (void)argc; + (void)argv; sol::state lua; lua.open_libraries(sol::lib::base); diff --git a/examples/source/tutorials/open_multiple_libraries.cpp b/examples/source/tutorials/open_multiple_libraries.cpp index eab0a2bd..dbca56d6 100644 --- a/examples/source/tutorials/open_multiple_libraries.cpp +++ b/examples/source/tutorials/open_multiple_libraries.cpp @@ -2,7 +2,9 @@ #include int main(int argc, char* argv[]) { - + // silence unused warnings + (void)argc; + (void)argv; sol::state lua; lua.open_libraries(sol::lib::base, sol::lib::coroutine, sol::lib::string, sol::lib::io); diff --git a/include/sol/usertype_container_launch.hpp b/include/sol/usertype_container_launch.hpp index 3c19dc17..b4d1dfae 100644 --- a/include/sol/usertype_container_launch.hpp +++ b/include/sol/usertype_container_launch.hpp @@ -27,6 +27,8 @@ #include #include +#include + namespace sol { namespace container_detail { diff --git a/include/sol/usertype_storage.hpp b/include/sol/usertype_storage.hpp index 689a88dd..232c43f8 100644 --- a/include/sol/usertype_storage.hpp +++ b/include/sol/usertype_storage.hpp @@ -28,6 +28,7 @@ #include #include +#include namespace sol { namespace u_detail { diff --git a/single/include/sol/config.hpp b/single/include/sol/config.hpp index c69d27b2..90ec711b 100644 --- a/single/include/sol/config.hpp +++ b/single/include/sol/config.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 2020-09-26 13:38:14.149661 UTC -// This header was generated with sol v3.2.1 (revision 1fb483d) +// Generated 2020-10-03 21:34:25.034794 UTC +// This header was generated with sol v3.2.1 (revision 48eea7b5) // https://github.com/ThePhD/sol2 #ifndef SOL_SINGLE_CONFIG_HPP diff --git a/single/include/sol/forward.hpp b/single/include/sol/forward.hpp index 547462b1..51fae7dd 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 2020-09-26 13:38:14.123663 UTC -// This header was generated with sol v3.2.1 (revision 1fb483d) +// Generated 2020-10-03 21:34:25.022965 UTC +// This header was generated with sol v3.2.1 (revision 48eea7b5) // 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 a3234161..c25fd549 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 2020-09-26 13:38:13.096661 UTC -// This header was generated with sol v3.2.1 (revision 1fb483d) +// Generated 2020-10-03 21:34:24.496436 UTC +// This header was generated with sol v3.2.1 (revision 48eea7b5) // https://github.com/ThePhD/sol2 #ifndef SOL_SINGLE_INCLUDE_HPP @@ -21137,6 +21137,8 @@ namespace sol { // end of sol/usertype_container.hpp +#include + namespace sol { namespace container_detail { @@ -21709,6 +21711,7 @@ namespace sol { // beginning of sol/usertype_storage.hpp #include +#include namespace sol { namespace u_detail { diff --git a/tests/regression_tests/simple/CMakeLists.txt b/tests/regression_tests/simple/CMakeLists.txt index b4ebc704..9e12b6cc 100644 --- a/tests/regression_tests/simple/CMakeLists.txt +++ b/tests/regression_tests/simple/CMakeLists.txt @@ -33,35 +33,7 @@ function(CREATE_TEST test_target_name test_name target_sol) EXPORT_NAME sol2::${test_name}) target_link_libraries(${test_target_name} PUBLIC Threads::Threads ${LUA_LIBRARIES} ${target_sol}) - - if (MSVC) - if (NOT CMAKE_COMPILER_ID MATCHES "Clang") - target_compile_options(${test_target_name} - PRIVATE /bigobj /W4) - endif() - else() - target_compile_options(${test_target_name} - PRIVATE -std=c++1z -pthread - -Wno-unknown-warning -Wno-unknown-warning-option - -Wall -Wpedantic -Werror -pedantic -pedantic-errors - -Wno-noexcept-type) - if (CMAKE_CXX_COMPILER_ID MATCHES "Clang") - # For another day, when C++ is not so crap - # and we have time to audit the entire lib - # for all uses of `detail::swallow`... - #target_compile_options(${test_target_name} - # PRIVATE -Wcomma) - endif() - - if (IS_X86) - if(MINGW) - set_target_properties(${test_target_name} - PROPERTIES - LINK_FLAGS -static-libstdc++) - endif() - endif() - endif() if (MSVC) target_compile_options(${test_target_name} PRIVATE /EHsc /std:c++latest)