🐛 Squash warnings with SYSTEM include

- Fixes #1139
This commit is contained in:
ThePhD 2021-03-07 14:46:13 -05:00
parent a53819531d
commit 0590f0e75c
No known key found for this signature in database
GPG Key ID: 1509DB1C0F702BFA
4 changed files with 8 additions and 7 deletions

View File

@ -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
$<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/include>
$<INSTALL_INTERFACE:include>)

View File

@ -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)

View File

@ -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 <sol/compatibility/compat-5.3.h>

View File

@ -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 <sol/compatibility/lua_version.hpp>