From 14e090f9bf5deb4b71c05c7f926468a93e28f6e3 Mon Sep 17 00:00:00 2001 From: halx99 Date: Fri, 31 Jul 2020 11:22:42 +0800 Subject: [PATCH] fix option order --- cmake/Modules/CocosConfigDepend.cmake | 1 - cocos/CMakeLists.txt | 24 ++++++++++++------------ cocos/audio/CMakeLists.txt | 4 ++-- 3 files changed, 14 insertions(+), 15 deletions(-) diff --git a/cmake/Modules/CocosConfigDepend.cmake b/cmake/Modules/CocosConfigDepend.cmake index e13e30ac93..5ee1845f01 100644 --- a/cmake/Modules/CocosConfigDepend.cmake +++ b/cmake/Modules/CocosConfigDepend.cmake @@ -37,7 +37,6 @@ macro(cocos2dx_depend) ${METAL_LIBRARY} ) - message(STATUS "[AudioBackend] CC_USE_ALSOFT_ON_APPLE=${CC_USE_ALSOFT_ON_APPLE}") if(NOT CC_USE_ALSOFT_ON_APPLE) find_library(OPENAL_LIBRARY OpenAL) set(COCOS_APPLE_LIBS diff --git a/cocos/CMakeLists.txt b/cocos/CMakeLists.txt index 7511a70c46..3a23d49042 100644 --- a/cocos/CMakeLists.txt +++ b/cocos/CMakeLists.txt @@ -34,6 +34,18 @@ set(COCOS2D_X_VERSION 4.0) set(COCOS_CORE_LIB cocos2d) project(cocos2d_libs) +# default value for cocos2dx extensions modules build +option(BUILD_EDITOR_COCOSTUDIO "Build editor support for cocostudio" ON) +option(BUILD_EDITOR_SPINE "Build editor support for spine" ON) +option(BUILD_EXTENSIONS "Build extension library" ON) +option(CC_USE_ALSOFT_ON_APPLE "Use openal-soft on apple platform" OFF) + +set(CC_USE_ALSOFT_ON_APPLE ${CC_USE_ALSOFT_ON_APPLE} CACHE BOOL "Use openal-soft on apple platform" FORCE) + +if(CC_USE_ALSOFT_ON_APPLE) + add_definitions(-DCC_USE_ALSOFT_ON_APPLE=1) +endif() + include(2d/CMakeLists.txt) include(3d/CMakeLists.txt) include(platform/CMakeLists.txt) @@ -47,18 +59,6 @@ include(ui/CMakeLists.txt) include(network/CMakeLists.txt) include(audio/CMakeLists.txt) -# default value for cocos2dx extensions modules build -option(BUILD_EDITOR_COCOSTUDIO "Build editor support for cocostudio" ON) -option(BUILD_EDITOR_SPINE "Build editor support for spine" ON) -option(BUILD_EXTENSIONS "Build extension library" ON) -option(CC_USE_ALSOFT_ON_APPLE "Use openal-soft on apple platform" OFF) - -set(CC_USE_ALSOFT_ON_APPLE ${CC_USE_ALSOFT_ON_APPLE} CACHE BOOL "Use openal-soft on apple platform" FORCE) - -if(CC_USE_ALSOFT_ON_APPLE) - add_definitions(-DCC_USE_ALSOFT_ON_APPLE=1) -endif() - if(BUILD_EDITOR_COCOSTUDIO) include(editor-support/cocostudio/CMakeLists.txt) set(COCOS_EDITOR_SUPPORT_SRC ${COCOS_EDITOR_SUPPORT_SRC} ${COCOS_CS_SRC} ${COCOS_CS_HEADER}) diff --git a/cocos/audio/CMakeLists.txt b/cocos/audio/CMakeLists.txt index 297a287b2b..760d8fb9ab 100644 --- a/cocos/audio/CMakeLists.txt +++ b/cocos/audio/CMakeLists.txt @@ -2,6 +2,8 @@ set(COCOS_AUDIO_SRC audio/AudioEngine.cpp ) + +message(STATUS "[AudioEngine] CC_USE_ALSOFT_ON_APPLE=${CC_USE_ALSOFT_ON_APPLE}") if(WINDOWS) @@ -76,8 +78,6 @@ elseif(LINUX) elseif(APPLE) # common - message(STATUS "[AudioEngine] CC_USE_ALSOFT_ON_APPLE=${CC_USE_ALSOFT_ON_APPLE}") - set(COCOS_AUDIO_PLATFORM_HEADER audio/include/AudioDecoderManager.h audio/include/AudioDecoder.h