correct iOS project config when using CMake `-GXcode` generate (3.17 round 2 test) (#18808)

* ARCH_DIR only useful for search linux prebuilt libs

* add iOS app target ONLY_ACTIVE_ARCH property

* set Xcode property for application, include all depend target

* fix bugs-editbox-win32 crash

* improve EditBox-align test case

* typo error

* update cocos-console submodule

* VS RelWithDebInfo build use release folder external libs
This commit is contained in:
leda 2018-05-11 15:09:09 +08:00 committed by minggo
parent f5e35cfe4f
commit 4675ee79cd
7 changed files with 45 additions and 11 deletions

View File

@ -334,9 +334,34 @@ macro(cocos_pak_xcode cocos_target)
message("cocos package: ${cocos_target}, plist file: ${COCOS_APP_INFO_PLIST}")
cocos_config_app_xcode_property(${cocos_target})
endmacro()
# set Xcode property for application, include all depend target
macro(cocos_config_app_xcode_property cocos_app)
cocos_config_target_xcode_property(${cocos_app})
# for example, cocos_target: cpp-tests link engine_lib: cocos2d
get_target_property(engine_libs ${cocos_app} LINK_LIBRARIES)
foreach(engine_lib ${engine_libs})
if(TARGET ${engine_lib})
cocos_config_target_xcode_property(${engine_lib})
# for example, engine_lib: cocos2d link external_lib: flatbuffers
get_target_property(external_libs ${engine_lib} LINK_LIBRARIES)
foreach(external_lib ${external_libs})
if(TARGET ${external_lib})
cocos_config_target_xcode_property(${external_lib})
endif()
endforeach()
endif()
endforeach()
endmacro()
# custom Xcode property for iOS target
macro(cocos_config_target_xcode_property cocos_target)
if(IOS)
set_xcode_property(${cocos_target} IPHONEOS_DEPLOYMENT_TARGET "8.0")
set_xcode_property(${cocos_target} ENABLE_BITCODE "NO")
set_xcode_property(${cocos_target} ONLY_ACTIVE_ARCH "YES")
endif()
endmacro()

View File

@ -47,13 +47,15 @@
endif()
message(STATUS "CMAKE_BUILD_TYPE: ${CMAKE_BUILD_TYPE}")
# architecture
if(CMAKE_SIZEOF_VOID_P EQUAL 8)
set(ARCH_DIR "64-bit")
elseif(CMAKE_SIZEOF_VOID_P EQUAL 4)
set(ARCH_DIR "32-bit")
else()
message(WARN "CMAKE_SIZEOF_VOID_P: ${CMAKE_SIZEOF_VOID_P}")
# ARCH_DIR only useful for search linux prebuilt libs
if(LINUX)
if(CMAKE_SIZEOF_VOID_P EQUAL 8)
set(ARCH_DIR "64-bit")
elseif(CMAKE_SIZEOF_VOID_P EQUAL 4)
set(ARCH_DIR "32-bit")
else()
message(WARNING "CMAKE_SIZEOF_VOID_P: ${CMAKE_SIZEOF_VOID_P}")
endif()
endif()
if("${CMAKE_CXX_COMPILER_ID}" STREQUAL "Clang")

View File

@ -5,9 +5,15 @@
# record all the prebuilt libs which found for specific platform
set(COCOS_EXTERNAL_LIBS)
# lib location is Debug folder or release folder
# Debug build use debug folder libs, Release build use release folder libs
string(TOLOWER ${CMAKE_BUILD_TYPE} BUILD_TYPE_FOLDER)
# RelWithDebInfo is one of Visual Studio 2017 default build type
if(${CMAKE_BUILD_TYPE} STREQUAL "RelWithDebInfo")
# RelWithDebInfo build use release folder libs
set(BUILD_TYPE_FOLDER "release")
endif()
set(_chipmunk_inc chipmunk/chipmunk.h)
set(_chipmunk_inc_paths include)
if(WINDOWS)

View File

@ -156,7 +156,7 @@ set(CMAKE_OSX_SYSROOT ${CMAKE_IOS_SDK_ROOT} CACHE PATH "Sysroot used for iOS sup
# set the architecture for iOS
if(IOS_PLATFORM STREQUAL "OS")
# set (IOS_ARCH armv7 armv7s arm64)
set(IOS_ARCH armv7 arm64)
set(IOS_ARCH arm64 armv7)
elseif(IOS_PLATFORM STREQUAL "SIMULATOR")
set(IOS_ARCH i386)
elseif(IOS_PLATFORM STREQUAL "SIMULATOR64")

View File

@ -405,7 +405,7 @@ namespace ui {
::ShowWindow(s_previousFocusWnd, SW_HIDE);
EditBoxImplWin* pThis = (EditBoxImplWin*)GetWindowLongPtrW(s_previousFocusWnd, GWLP_USERDATA);
if (!pThis->_hasFocus)
if (pThis!=nullptr && !pThis->_hasFocus)
{
if (pThis->_editingMode && !IsWindowVisible(s_previousFocusWnd))
{

View File

@ -326,6 +326,7 @@ bool UIEditBoxTestTextHorizontalAlignment::init() {
editbox->setFontColor(Color3B::RED);
editbox->setPlaceHolder(text.c_str());
editbox->setPlaceholderFontColor(Color3B::WHITE);
editbox->setPlaceholderFontSize(editBoxSize.height/2);
editbox->setFontSize(editBoxSize.height/2);
editbox->setText(text.c_str());
editbox->setTextHorizontalAlignment(alignment);

@ -1 +1 @@
Subproject commit 1b69aa81a05d727cd15d5d41c94c0e7332bb622e
Subproject commit 958531ee955b08f9b388847b7ab9eb0bb468c18c