From b122a1b96ae69878f5971e7c9458bcb5d3eada52 Mon Sep 17 00:00:00 2001 From: halx99 Date: Thu, 2 May 2024 20:59:29 +0800 Subject: [PATCH] Fix linking prebuilt error - Add missing preprocessors - Use plain name for zlib & png to avoid linking prebuilt axmol error --- 3rdparty/png/CMakeLists.txt | 2 +- 3rdparty/zlib/CMakeLists.txt | 2 +- cmake/Modules/AXLinkHelpers.cmake | 8 +++++++- 3 files changed, 9 insertions(+), 3 deletions(-) diff --git a/3rdparty/png/CMakeLists.txt b/3rdparty/png/CMakeLists.txt index 9d090fa8358b..062dd06264d7 100644 --- a/3rdparty/png/CMakeLists.txt +++ b/3rdparty/png/CMakeLists.txt @@ -67,4 +67,4 @@ endif() # Export png as PNG::PNG to avoid cmake builtin FindPNG.cmake add target again add_library(PNG::PNG ALIAS ${target_name}) set(PNG_PNG_INCLUDE_DIR "${CMAKE_CURRENT_LIST_DIR}" CACHE STRING "png include dir" FORCE) -set(PNG_LIBRARY "PNG::PNG" CACHE STRING "png include dir" FORCE) +set(PNG_LIBRARY "png" CACHE INTERNAL "png include dir" FORCE) diff --git a/3rdparty/zlib/CMakeLists.txt b/3rdparty/zlib/CMakeLists.txt index eb81b775a627..6dc0f78fb51b 100644 --- a/3rdparty/zlib/CMakeLists.txt +++ b/3rdparty/zlib/CMakeLists.txt @@ -33,4 +33,4 @@ set_target_properties(${target_name} PROPERTIES # Export zlib as ZLIB::ZLIB to avoid cmake builtin FindPNG.cmake add target again add_library(ZLIB::ZLIB ALIAS ${target_name}) set(ZLIB_INCLUDE_DIR "${zlib_INC_DIR}" CACHE STRING "zlib include dir" FORCE) -set(ZLIB_LIBRARY "ZLIB::ZLIB" CACHE STRING "zlib library" FORCE) +set(ZLIB_LIBRARY "zlib" CACHE INTERNAL "zlib library" FORCE) diff --git a/cmake/Modules/AXLinkHelpers.cmake b/cmake/Modules/AXLinkHelpers.cmake index 65fd208b92c4..aa6fd9a655fe 100644 --- a/cmake/Modules/AXLinkHelpers.cmake +++ b/cmake/Modules/AXLinkHelpers.cmake @@ -44,8 +44,14 @@ function(ax_link_cxx_prebuilt APP_NAME AX_ROOT_DIR AX_PREBUILT_DIR) ) ax_config_pred(${APP_NAME} AX_USE_ALSOFT) - ax_config_pred(${APP_NAME} AX_ENABLE_MFMEDIA) ax_config_pred(${APP_NAME} AX_ENABLE_MSEDGE_WEBVIEW2) + ax_config_pred(${APP_NAME} AX_ENABLE_PHYSICS) + ax_config_pred(${APP_NAME} AX_ENABLE_3D) + ax_config_pred(${APP_NAME} AX_ENABLE_3D_PHYSICS) + ax_config_pred(${APP_NAME} AX_ENABLE_NAVMESH) + ax_config_pred(${APP_NAME} AX_ENABLE_MEDIA) + ax_config_pred(${APP_NAME} AX_ENABLE_AUDIO) + ax_config_pred(${APP_NAME} AX_ENABLE_CONSOLE) if (AX_ISA_SIMD MATCHES "sse") target_compile_definitions(${APP_NAME} PRIVATE AX_USE_SSE=1)