Fix linking prebuilt error

- Add missing preprocessors
- Use plain name for zlib & png to avoid linking prebuilt axmol error
This commit is contained in:
halx99 2024-05-02 20:59:29 +08:00
parent 13a7258150
commit b122a1b96a
3 changed files with 9 additions and 3 deletions

View File

@ -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)

View File

@ -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)

View File

@ -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)