diff --git a/CMakeLists.txt b/CMakeLists.txt index b2cc9e48..07d8b541 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -25,7 +25,7 @@ cmake_minimum_required(VERSION 3.15.0) # # # project declaration -project(sol2 VERSION 3.2.5 LANGUAGES CXX C) +project(sol2 VERSION 4.0.0 LANGUAGES CXX C) # # # Modules # # Include modules useful to the project, whether locally made in our own cmake DIRECTORY @@ -51,6 +51,7 @@ set(SOL2_LUA_VERSION "5.3.5" CACHE STRING "The version of Lua needed. Can be 5.1 set(SOL2_BUILD_LUA TRUE CACHE BOOL "Always build Lua, do not search for it in the system") set(SOL2_PLATFORM "x64" CACHE STRING "Target platform to compile for when building binaries (x86, x64)") option(SOL2_CI "Whether or not we are in continguous integration mode" OFF) +option(SOL2_SYSTEM_INCLUDE "Whether or not sol2 should be considered a system include. This helps suppress errors for when the sol2 author is a big derp and doesn't fix every single warning, ever." ON) option(SOL2_TESTS "Enable build of tests" OFF) option(SOL2_EXAMPLES "Enable build of examples" OFF) option(SOL2_INTEROP_EXAMPLES "Enable build of interop examples" OFF) @@ -92,6 +93,10 @@ else() set(IS_X64 TRUE) endif() +if (SOL2_SYSTEM_INCLUDE) + set(--sol2-system-include SYSTEM) +endif() + # # # sol2 Source Groups # # Sources everyone is going to need # Header files @@ -107,7 +112,7 @@ set_target_properties(sol2 PROPERTIES EXPORT_NAME sol2::sol2) -target_include_directories(sol2 INTERFACE +target_include_directories(sol2 ${--sol2-system-include} INTERFACE $ $) diff --git a/tests/inclusion/CMakeLists.txt b/tests/inclusion/CMakeLists.txt index d3d7af53..028567b4 100644 --- a/tests/inclusion/CMakeLists.txt +++ b/tests/inclusion/CMakeLists.txt @@ -40,7 +40,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} ${CMAKE_DL_LIBS}) - target_compile_options(${test_target_name} + target_compile_definitions(${test_target_name} PRIVATE SOL_ENABLE_INTEROP=1 SOL_ALL_SAFETIES_ON=1) diff --git a/tests/inclusion/source/compatibility/compat-5.3.cpp b/tests/inclusion/source/compatibility/compat-5.3.cpp index 116ec195..450460f9 100644 --- a/tests/inclusion/source/compatibility/compat-5.3.cpp +++ b/tests/inclusion/source/compatibility/compat-5.3.cpp @@ -21,6 +21,4 @@ // IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN // CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. -#include "../sol_defines.hpp" - #include diff --git a/tests/inclusion/source/compatibility/lua_version.cpp b/tests/inclusion/source/compatibility/lua_version.cpp index 0950c164..0b6e9c6b 100644 --- a/tests/inclusion/source/compatibility/lua_version.cpp +++ b/tests/inclusion/source/compatibility/lua_version.cpp @@ -21,6 +21,4 @@ // IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN // CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. -#include "../sol_defines.hpp" - #include