Fix macos compile Issue (#324)

Related [Issue 206](https://github.com/BeamMP/BeamMP-Server/issues/206)
This commit is contained in:
Lion 2024-05-19 12:57:49 +02:00 committed by GitHub
commit c880460a55
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 7 additions and 3 deletions

View File

@ -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 ()
@ -216,4 +221,3 @@ if(${PROJECT_NAME}_ENABLE_UNIT_TESTING)
target_link_options(${PROJECT_NAME}-tests PRIVATE "/SUBSYSTEM:CONSOLE")
endif(MSVC)
endif()

View File

@ -268,7 +268,7 @@ std::vector<std::string> TLuaEngine::StateThreadData::GetStateTableKeys(const st
for (size_t i = 0; i < keys.size(); ++i) {
auto obj = current.get<sol::object>(keys.at(i));
if (obj.get_type() == sol::type::nil) {
if (obj.get_type() == sol::type::lua_nil) {
// error
break;
} else if (i == keys.size() - 1) {