From 94f3b94d55a43c0a44a275ea828c86b14b412e6c Mon Sep 17 00:00:00 2001 From: halx99 Date: Tue, 22 Feb 2022 19:09:34 +0800 Subject: [PATCH] Fix use prebuilt engine libs for win64 --- templates/cpp-template-default/CMakeLists.txt | 11 +++++++++-- templates/lua-template-default/CMakeLists.txt | 11 +++++++++-- tools/console/bin/adxe.bat | 2 +- 3 files changed, 19 insertions(+), 5 deletions(-) diff --git a/templates/cpp-template-default/CMakeLists.txt b/templates/cpp-template-default/CMakeLists.txt index 2047bd4ca4..d7d3d83ade 100644 --- a/templates/cpp-template-default/CMakeLists.txt +++ b/templates/cpp-template-default/CMakeLists.txt @@ -181,6 +181,9 @@ endif() if(WINDOWS) set_property(TARGET ${APP_NAME} PROPERTY VS_DEBUGGER_WORKING_DIRECTORY "${GAME_RES_FOLDER}") + if(NOT DEFINED BUILD_ENGINE_DONE) + set_property(DIRECTORY PROPERTY VS_STARTUP_PROJECT ${APP_NAME}) + endif() elseif(LINUX) cocos_get_resource_path(APP_RES_DIR ${APP_NAME}) cocos_copy_target_res(${APP_NAME} LINK_TO ${APP_RES_DIR} FOLDERS ${GAME_RES_FOLDER}) @@ -300,10 +303,14 @@ if (_AX_USE_PREBUILT) # support windows only # Copy dlls to app bin dir # copy thirdparty dlls to target bin dir # copy_thirdparty_dlls(${APP_NAME} $) + set(ssl_dll_suffix "") + if(WIN64) + set(ssl_dll_suffix "-${ARCH_ALIAS}") + endif() add_custom_command(TARGET ${APP_NAME} POST_BUILD COMMAND ${CMAKE_COMMAND} -E copy_if_different - "${ADXE_ROOT_PATH}/thirdparty/openssl/prebuilt/windows/${ARCH_ALIAS}/libcrypto-3.dll" - "${ADXE_ROOT_PATH}/thirdparty/openssl/prebuilt/windows/${ARCH_ALIAS}/libssl-3.dll" + "${ADXE_ROOT_PATH}/thirdparty/openssl/prebuilt/windows/${ARCH_ALIAS}/libcrypto-3${ssl_dll_suffix}.dll" + "${ADXE_ROOT_PATH}/thirdparty/openssl/prebuilt/windows/${ARCH_ALIAS}/libssl-3${ssl_dll_suffix}.dll" "${ADXE_ROOT_PATH}/thirdparty/curl/prebuilt/windows/${ARCH_ALIAS}/libcurl.dll" "${ADXE_ROOT_PATH}/thirdparty/zlib/prebuilt/windows/${ARCH_ALIAS}/zlib1.dll" "${ADXE_ROOT_PATH}/${AX_PREBUILT_DIR}/bin/\$\(Configuration\)/OpenAL32.dll" diff --git a/templates/lua-template-default/CMakeLists.txt b/templates/lua-template-default/CMakeLists.txt index 99dbed76b3..fa2cab2497 100644 --- a/templates/lua-template-default/CMakeLists.txt +++ b/templates/lua-template-default/CMakeLists.txt @@ -188,6 +188,9 @@ if(WINDOWS) set(my_res_folder "${CMAKE_CURRENT_SOURCE_DIR}") cocos_copy_lua_scripts(${APP_NAME} ${res_script_folders} "${my_res_folder}/src/cocos") set_property(TARGET ${APP_NAME} PROPERTY VS_DEBUGGER_WORKING_DIRECTORY "${my_res_folder}") + if(NOT DEFINED BUILD_ENGINE_DONE) + set_property(DIRECTORY PROPERTY VS_STARTUP_PROJECT ${APP_NAME}) + endif() elseif(LINUX) cocos_get_resource_path(APP_RES_DIR ${APP_NAME}) cocos_copy_target_res(${APP_NAME} LINK_TO ${APP_RES_DIR}/res FOLDERS ${res_res_folders}) @@ -314,10 +317,14 @@ if (_AX_USE_PREBUILT) # support windows only # Copy dlls to app bin dir # copy thirdparty dlls to target bin dir # copy_thirdparty_dlls(${APP_NAME} $) + set(ssl_dll_suffix "") + if(WIN64) + set(ssl_dll_suffix "-${ARCH_ALIAS}") + endif() add_custom_command(TARGET ${APP_NAME} POST_BUILD COMMAND ${CMAKE_COMMAND} -E copy_if_different - "${ADXE_ROOT_PATH}/thirdparty/openssl/prebuilt/windows/${ARCH_ALIAS}/libcrypto-3.dll" - "${ADXE_ROOT_PATH}/thirdparty/openssl/prebuilt/windows/${ARCH_ALIAS}/libssl-3.dll" + "${ADXE_ROOT_PATH}/thirdparty/openssl/prebuilt/windows/${ARCH_ALIAS}/libcrypto-3${ssl_dll_suffix}.dll" + "${ADXE_ROOT_PATH}/thirdparty/openssl/prebuilt/windows/${ARCH_ALIAS}/libssl-3${ssl_dll_suffix}.dll" "${ADXE_ROOT_PATH}/thirdparty/curl/prebuilt/windows/${ARCH_ALIAS}/libcurl.dll" "${ADXE_ROOT_PATH}/thirdparty/zlib/prebuilt/windows/${ARCH_ALIAS}/zlib1.dll" "${ADXE_ROOT_PATH}/${AX_PREBUILT_DIR}/bin/\$\(Configuration\)/OpenAL32.dll" diff --git a/tools/console/bin/adxe.bat b/tools/console/bin/adxe.bat index 37a984f1cc..6cc42cb54a 100644 --- a/tools/console/bin/adxe.bat +++ b/tools/console/bin/adxe.bat @@ -1,4 +1,4 @@ @echo off rem Ensure vswhere installed for cmdline tool could find vs2017+ pip install vswhere -"%~dp0/adxe.py" %* +python "%~dp0/adxe.py" %*