From 40e54968198bb2a1093207962feb44be1f17a26f Mon Sep 17 00:00:00 2001 From: Maximilian Rehms Date: Sat, 18 May 2024 15:06:26 +0200 Subject: [PATCH 1/3] compiles now on macos --- CMakeLists.txt | 9 +++++++++ src/TLuaEngine.cpp | 2 +- 2 files changed, 10 insertions(+), 1 deletion(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index c51779d..fdbf0d8 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -173,6 +173,11 @@ add_library(commandline_static deps/commandline/src/backends/BufferedBackend.cpp deps/commandline/src/backends/BufferedBackend.h ) + +# Ensure the commandline library uses C++11 +set_target_properties(commandline_static PROPERTIES CXX_STANDARD 11 CXX_STANDARD_REQUIRED YES) + + if (WIN32) target_compile_definitions(commandline_static PRIVATE -DPLATFORM_WINDOWS=1) else () @@ -217,3 +222,7 @@ if(${PROJECT_NAME}_ENABLE_UNIT_TESTING) endif(MSVC) endif() +# Specific AppleClang options to suppress C++11 extension warnings - probably optional because it could hinder trouble shooting +if (CMAKE_CXX_COMPILER_ID STREQUAL "AppleClang") + add_compile_options(-Wno-c++11-extensions) +endif () \ No newline at end of file diff --git a/src/TLuaEngine.cpp b/src/TLuaEngine.cpp index f990ae8..e231982 100644 --- a/src/TLuaEngine.cpp +++ b/src/TLuaEngine.cpp @@ -268,7 +268,7 @@ std::vector TLuaEngine::StateThreadData::GetStateTableKeys(const st for (size_t i = 0; i < keys.size(); ++i) { auto obj = current.get(keys.at(i)); - if (obj.get_type() == sol::type::nil) { + if (obj.get_type() == sol::type::none) { // error break; } else if (i == keys.size() - 1) { From 785c5343cda11f77d8ea305e6ec6229a54122105 Mon Sep 17 00:00:00 2001 From: Maximilian Rehms Date: Sat, 18 May 2024 15:11:42 +0200 Subject: [PATCH 2/3] removed warnig suppression --- CMakeLists.txt | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index fdbf0d8..4d23747 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -220,9 +220,4 @@ if(${PROJECT_NAME}_ENABLE_UNIT_TESTING) if(MSVC) target_link_options(${PROJECT_NAME}-tests PRIVATE "/SUBSYSTEM:CONSOLE") endif(MSVC) -endif() - -# Specific AppleClang options to suppress C++11 extension warnings - probably optional because it could hinder trouble shooting -if (CMAKE_CXX_COMPILER_ID STREQUAL "AppleClang") - add_compile_options(-Wno-c++11-extensions) -endif () \ No newline at end of file +endif() \ No newline at end of file From 7f54bcfaec05d093623c8da9891b45591c2e17c4 Mon Sep 17 00:00:00 2001 From: Maximilian Rehms <74744500+max5800@users.noreply.github.com> Date: Sat, 18 May 2024 22:36:57 +0200 Subject: [PATCH 3/3] successful implemented suggested change to "lua_nil" Co-authored-by: Lion --- src/TLuaEngine.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/TLuaEngine.cpp b/src/TLuaEngine.cpp index e231982..4493158 100644 --- a/src/TLuaEngine.cpp +++ b/src/TLuaEngine.cpp @@ -268,7 +268,7 @@ std::vector TLuaEngine::StateThreadData::GetStateTableKeys(const st for (size_t i = 0; i < keys.size(); ++i) { auto obj = current.get(keys.at(i)); - if (obj.get_type() == sol::type::none) { + if (obj.get_type() == sol::type::lua_nil) { // error break; } else if (i == keys.size() - 1) {