diff --git a/cocos/scripting/lua-bindings/CMakeLists.txt b/cocos/scripting/lua-bindings/CMakeLists.txt index 5b00b863c9..22084d136f 100644 --- a/cocos/scripting/lua-bindings/CMakeLists.txt +++ b/cocos/scripting/lua-bindings/CMakeLists.txt @@ -56,7 +56,9 @@ if(WINDOWS) ${cocos_root}/external/lua/luasocket/wsocket.c ) elseif(UNIX) - add_definitions(-D_POSIX_C_SOURCE=200809L -D_DEFAULT_SOURCE) + if(LINUX) + add_definitions(-D_POSIX_C_SOURCE=200809L -D_DEFAULT_SOURCE) + endif() list(APPEND lua_cocos2d_source_files ${cocos_root}/external/lua/luasocket/serial.c ${cocos_root}/external/lua/luasocket/unix.c