From c3c7f42d916ad36a082ed70a431cec4072528ba4 Mon Sep 17 00:00:00 2001 From: ThePhD Date: Sun, 10 Dec 2017 01:34:48 -0500 Subject: [PATCH] update cmakelists for new tests fix problematic macro expansion issues --- CMakeLists.txt | 7 ++++--- single/sol/sol.hpp | 24 ++++++++++-------------- single/sol/sol_forward.hpp | 4 ++-- sol/simple_usertype_metatable.hpp | 10 ++++------ sol/usertype_metatable.hpp | 10 ++++------ 5 files changed, 24 insertions(+), 31 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 6e82e6bc..483c312c 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -57,7 +57,7 @@ if (NOT MSVC) endif() if (EXAMPLES) - file(GLOB EXAMPLES_SRC examples/*.cpp) + file(GLOB EXAMPLES_SRC examples/*.cpp examples/tutorials/quick_n_dirty/*.cpp) source_group(examples FILES ${EXAMPLES_SRC}) foreach(example_source_file ${EXAMPLES_SRC}) get_filename_component(example_name ${example_source_file} NAME_WE) @@ -83,9 +83,10 @@ endif() find_package(PythonInterp 3) if (PYTHONINTERP_FOUND) - add_custom_command(OUTPUT single/sol/sol.hpp COMMAND ${PYTHON_EXECUTABLE} ${CMAKE_CURRENT_SOURCE_DIR}/single.py --output ${CMAKE_CURRENT_SOURCE_DIR}/single/sol/sol.hpp DEPENDS ${HEADER_SRCS}) - add_custom_target(single_sol DEPENDS single/sol/sol.hpp) + add_custom_command(OUTPUT single/sol/sol.hpp single/sol/sol_forward.hpp COMMAND ${PYTHON_EXECUTABLE} ${CMAKE_CURRENT_SOURCE_DIR}/single.py --output ${CMAKE_CURRENT_SOURCE_DIR}/single/sol/sol.hpp DEPENDS ${HEADER_SRCS}) + add_custom_target(single_sol DEPENDS single/sol/sol.hpp single/sol/sol_forward.hpp) install(FILES "${CMAKE_CURRENT_SOURCE_DIR}/single/sol/sol.hpp" DESTINATION include/sol) + install(FILES "${CMAKE_CURRENT_SOURCE_DIR}/single/sol/sol_forward.hpp" DESTINATION include/sol) message(STATUS "single_sol can be generated as python 3 has been found.") else() message(STATUS "single_sol cannot be generated as python 3 has not been found.") diff --git a/single/sol/sol.hpp b/single/sol/sol.hpp index 0ef4b1a3..377c5c57 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 2017-12-09 07:45:45.246313 UTC -// This header was generated with sol v2.19.0 (revision 5f68853) +// Generated 2017-12-10 06:34:23.982786 UTC +// This header was generated with sol v2.19.0 (revision 87b4dd6) // https://github.com/ThePhD/sol2 #ifndef SOL_SINGLE_INCLUDE_HPP @@ -16964,21 +16964,19 @@ namespace sol { case meta_function::construct: if (prop) { #ifndef SOL_NO_EXCEPTIONS - throw error( + throw error("sol: 2 separate constructor (new) functions were set on this type. Please specify only 1 sol::meta_function::construct/'new' type AND wrap the function in a sol::factories/initializers call, as shown by the documentation and examples, otherwise you may create problems"); #else - assert(false && + assert(false && "sol: 2 separate constructor (new) functions were set on this type. Please specify only 1 sol::meta_function::construct/'new' type AND wrap the function in a sol::factories/initializers call, as shown by the documentation and examples, otherwise you may create problems"); #endif - "sol: 2 separate constructor (new) functions were set on this type. Please specify only 1 sol::meta_function::construct/'new' type AND wrap the function in a sol::factories/initializers call, as shown by the documentation and examples, otherwise you may create problems"); } break; case meta_function::garbage_collect: if (destructfunc != nullptr) { #ifndef SOL_NO_EXCEPTIONS - throw error( + throw error("sol: 2 separate constructor (new) functions were set on this type. Please specify only 1 sol::meta_function::construct/'new' type AND wrap the function in a sol::factories/initializers call, as shown by the documentation and examples, otherwise you may create problems"); #else - assert(false && + assert(false && "sol: 2 separate constructor (new) functions were set on this type. Please specify only 1 sol::meta_function::construct/'new' type AND wrap the function in a sol::factories/initializers call, as shown by the documentation and examples, otherwise you may create problems"); #endif - "sol: 2 separate garbage_collect functions were set on this type. Please specify only 1 sol::meta_function::gc type AND wrap the function in a sol::destruct call, as shown by the documentation and examples"); } destructfunc = reg.func; return; @@ -17695,21 +17693,19 @@ namespace sol { case meta_function::construct: if (prop) { #ifndef SOL_NO_EXCEPTIONS - throw error( + throw error("sol: 2 separate constructor (new) functions were set on this type. Please specify only 1 sol::meta_function::construct/'new' type AND wrap the function in a sol::factories/initializers call, as shown by the documentation and examples, otherwise you may create problems"); #else - assert(false && + assert(false && "sol: 2 separate constructor (new) functions were set on this type. Please specify only 1 sol::meta_function::construct/'new' type AND wrap the function in a sol::factories/initializers call, as shown by the documentation and examples, otherwise you may create problems"); #endif - "sol: 2 separate constructor (new) functions were set on this type. Please specify only 1 sol::meta_function::construct/'new' type AND wrap the function in a sol::factories/initializers call, as shown by the documentation and examples, otherwise you may create problems"); } break; case meta_function::garbage_collect: if (prop) { #ifndef SOL_NO_EXCEPTIONS - throw error( + throw error("sol: 2 separate constructor (new) functions were set on this type. Please specify only 1 sol::meta_function::construct/'new' type AND wrap the function in a sol::factories/initializers call, as shown by the documentation and examples, otherwise you may create problems"); #else - assert(false && + assert(false && "sol: 2 separate constructor (new) functions were set on this type. Please specify only 1 sol::meta_function::construct/'new' type AND wrap the function in a sol::factories/initializers call, as shown by the documentation and examples, otherwise you may create problems"); #endif - "sol: 2 separate garbage_collect functions were set on this type. Please specify only 1 sol::meta_function::gc type AND wrap the function in a sol::destruct call, as shown by the documentation and examples"); } return; default: diff --git a/single/sol/sol_forward.hpp b/single/sol/sol_forward.hpp index 63f6445b..ea3aa333 100644 --- a/single/sol/sol_forward.hpp +++ b/single/sol/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 2017-12-09 07:45:45.424818 UTC -// This header was generated with sol v2.19.0 (revision 5f68853) +// Generated 2017-12-10 06:34:24.172779 UTC +// This header was generated with sol v2.19.0 (revision 87b4dd6) // https://github.com/ThePhD/sol2 #ifndef SOL_SINGLE_INCLUDE_FORWARD_HPP diff --git a/sol/simple_usertype_metatable.hpp b/sol/simple_usertype_metatable.hpp index 1a738249..d44c2890 100644 --- a/sol/simple_usertype_metatable.hpp +++ b/sol/simple_usertype_metatable.hpp @@ -433,21 +433,19 @@ namespace sol { case meta_function::construct: if (prop) { #ifndef SOL_NO_EXCEPTIONS - throw error( + throw error("sol: 2 separate constructor (new) functions were set on this type. Please specify only 1 sol::meta_function::construct/'new' type AND wrap the function in a sol::factories/initializers call, as shown by the documentation and examples, otherwise you may create problems"); #else - assert(false && + assert(false && "sol: 2 separate constructor (new) functions were set on this type. Please specify only 1 sol::meta_function::construct/'new' type AND wrap the function in a sol::factories/initializers call, as shown by the documentation and examples, otherwise you may create problems"); #endif - "sol: 2 separate constructor (new) functions were set on this type. Please specify only 1 sol::meta_function::construct/'new' type AND wrap the function in a sol::factories/initializers call, as shown by the documentation and examples, otherwise you may create problems"); } break; case meta_function::garbage_collect: if (prop) { #ifndef SOL_NO_EXCEPTIONS - throw error( + throw error("sol: 2 separate constructor (new) functions were set on this type. Please specify only 1 sol::meta_function::construct/'new' type AND wrap the function in a sol::factories/initializers call, as shown by the documentation and examples, otherwise you may create problems"); #else - assert(false && + assert(false && "sol: 2 separate constructor (new) functions were set on this type. Please specify only 1 sol::meta_function::construct/'new' type AND wrap the function in a sol::factories/initializers call, as shown by the documentation and examples, otherwise you may create problems"); #endif - "sol: 2 separate garbage_collect functions were set on this type. Please specify only 1 sol::meta_function::gc type AND wrap the function in a sol::destruct call, as shown by the documentation and examples"); } return; default: diff --git a/sol/usertype_metatable.hpp b/sol/usertype_metatable.hpp index 8a74285a..7d767585 100644 --- a/sol/usertype_metatable.hpp +++ b/sol/usertype_metatable.hpp @@ -469,21 +469,19 @@ namespace sol { case meta_function::construct: if (prop) { #ifndef SOL_NO_EXCEPTIONS - throw error( + throw error("sol: 2 separate constructor (new) functions were set on this type. Please specify only 1 sol::meta_function::construct/'new' type AND wrap the function in a sol::factories/initializers call, as shown by the documentation and examples, otherwise you may create problems"); #else - assert(false && + assert(false && "sol: 2 separate constructor (new) functions were set on this type. Please specify only 1 sol::meta_function::construct/'new' type AND wrap the function in a sol::factories/initializers call, as shown by the documentation and examples, otherwise you may create problems"); #endif - "sol: 2 separate constructor (new) functions were set on this type. Please specify only 1 sol::meta_function::construct/'new' type AND wrap the function in a sol::factories/initializers call, as shown by the documentation and examples, otherwise you may create problems"); } break; case meta_function::garbage_collect: if (destructfunc != nullptr) { #ifndef SOL_NO_EXCEPTIONS - throw error( + throw error("sol: 2 separate constructor (new) functions were set on this type. Please specify only 1 sol::meta_function::construct/'new' type AND wrap the function in a sol::factories/initializers call, as shown by the documentation and examples, otherwise you may create problems"); #else - assert(false && + assert(false && "sol: 2 separate constructor (new) functions were set on this type. Please specify only 1 sol::meta_function::construct/'new' type AND wrap the function in a sol::factories/initializers call, as shown by the documentation and examples, otherwise you may create problems"); #endif - "sol: 2 separate garbage_collect functions were set on this type. Please specify only 1 sol::meta_function::gc type AND wrap the function in a sol::destruct call, as shown by the documentation and examples"); } destructfunc = reg.func; return;