* add nx support

* fix nx external compiler error

* format code

* nx if use nvn, no need use tbb

* windows cl.exe not  support -include compile flag

* update pvmp3dec cmake , support windows
This commit is contained in:
yangchao 2022-05-28 20:10:19 +08:00 committed by GitHub
parent ea41ab8f47
commit 40e0ab05b8
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 24 additions and 8 deletions

View File

@ -10,8 +10,7 @@ list(APPEND CC_EXTERNAL_PRIVATE_DEFINITIONS
MESSAGE(STATUS "platform path: ${platform_spec_path}")
include(${CMAKE_CURRENT_LIST_DIR}/cmake/CocosExternalConfig.cmake)
include(${CMAKE_CURRENT_LIST_DIR}/sources/CMakeLists.txt)
if(WINDOWS)
if(WINDOWS OR NX_WINDOWS)
if(${CMAKE_SIZEOF_VOID_P} STREQUAL "4")
include(${CMAKE_CURRENT_LIST_DIR}/win32/CMakeLists.txt)
else()
@ -32,4 +31,5 @@ elseif(EMSCRIPTEN)
include(${CMAKE_CURRENT_LIST_DIR}/emscripten/CMakeLists.txt)
elseif(LINUX)
include(${CMAKE_CURRENT_LIST_DIR}/linux/CMakeLists.txt)
elseif(NX)
endif()

View File

@ -45,7 +45,9 @@ if(NOT USE_MODULES)
endif()
# add dependent boost libs
if(NOT NX)
include(${CMAKE_CURRENT_LIST_DIR}/boost-source/boost.cmake)
endif()
if(ANDROID AND CC_ENABLE_SWAPPY)
@ -57,7 +59,7 @@ add_definitions(-DCC_SWAPPY_ENABLED)
endif()
if(ANDROID OR OHOS)
if(ANDROID OR OHOS OR NX)
include(${CMAKE_CURRENT_LIST_DIR}/pvmp3dec/CMakeLists.txt)
include(${CMAKE_CURRENT_LIST_DIR}/tremolo/CMakeLists.txt)
@ -75,11 +77,18 @@ elseif(APPLE)
if(USE_SOCKET)
include(${CMAKE_CURRENT_LIST_DIR}/SocketRocket/CMakeLists.txt)
endif()
elseif(NX_WINDOWS)
include(${CMAKE_CURRENT_LIST_DIR}/pvmp3dec/CMakeLists.txt)
list(APPEND CC_EXTERNAL_LIBS
pvmp3dec
)
endif()
if((NOT NX_WINDOWS) AND (NOT NX))
list(APPEND CC_EXTERNAL_INCLUDES
${CMAKE_CURRENT_LIST_DIR}
)
endif()
if(USE_PHYSICS_PHYSX)
list(APPEND CC_EXTERNAL_INCLUDES

View File

@ -62,9 +62,16 @@ if(NOT EXISTS ${CMAKE_CURRENT_BINARY_DIR}/pvmp3dec_tmp_def.h)
file(WRITE ${CMAKE_CURRENT_BINARY_DIR}/pvmp3dec_tmp_def.h "#pragma once\n#define OSCL_UNUSED_ARG(x) (void)(x)")
endif()
if(WINDOWS OR NX_WINDOWS)
target_compile_options(pvmp3dec PRIVATE
#-fsanitize=signed-integer-overflow
/FI ${CMAKE_CURRENT_BINARY_DIR}/pvmp3dec_tmp_def.h
#
)
else()
target_compile_options(pvmp3dec PRIVATE
#-fsanitize=signed-integer-overflow
-include ${CMAKE_CURRENT_BINARY_DIR}/pvmp3dec_tmp_def.h
#
)
endif()