diff --git a/native/CMakeLists.txt b/native/CMakeLists.txt index 5e8077fcb6c..3b76038ed4f 100644 --- a/native/CMakeLists.txt +++ b/native/CMakeLists.txt @@ -83,6 +83,13 @@ if(USE_SERVER_MODE) add_definitions(-DCC_SERVER_MODE) endif() +# Fix the issue: https://github.com/cocos/cocos-engine/issues/16190 +# std::unary_function was removed since clang 15 +# The macro has already been defined in boost/config/stdlib/dinkumware.hpp(258,1), +# so no need to define it again to avoid 'macro redefinition' error. +if(NOT WINDOWS) + add_definitions(-DBOOST_NO_CXX98_FUNCTION_BASE) +endif() add_definitions(-DCC_NETMODE_CLIENT=0) add_definitions(-DCC_NETMODE_LISTEN_SERVER=1)