Skip to content

Commit

Permalink
Fix linking prebuilt error
Browse files Browse the repository at this point in the history
- Add missing preprocessors
- Use plain name for zlib & png to avoid linking prebuilt axmol error
  • Loading branch information
halx99 committed May 2, 2024
1 parent 13a7258 commit b122a1b
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 3 deletions.
2 changes: 1 addition & 1 deletion 3rdparty/png/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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)
2 changes: 1 addition & 1 deletion 3rdparty/zlib/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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)
8 changes: 7 additions & 1 deletion cmake/Modules/AXLinkHelpers.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down

0 comments on commit b122a1b

Please sign in to comment.