From 62557318d70b3cd206c5daacc95a9ed2ccf12f42 Mon Sep 17 00:00:00 2001 From: Laura Hermanns Date: Thu, 14 Sep 2023 20:16:53 -0400 Subject: [PATCH] Minor changes in CMakeLists.txt script. --- CMakeLists.txt | 5 +++++ sources/Renderer/Metal/CMakeLists.txt | 2 +- 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index fa0bee0ae4..a71b58bfeb 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -205,7 +205,12 @@ endfunction() function(append_global_property PROP_NAME OUTPUT_LIST NEW_ITEM) get_property(PropertyList GLOBAL PROPERTY ${PROP_NAME}) + + # Link base libs first to avoid wrong order in GCC. + # For Clang, this order can cause duplicate linking entries, but shouldn't hurt. + # For now it's not worth the trouble having to distinguish between compiler toolchains (see CMAKE_CXX_COMPILER_ID). list(APPEND PropertyList ${NEW_ITEM}) + set_property(GLOBAL PROPERTY ${PROP_NAME} "${PropertyList}") set(${OUTPUT_LIST} "${PropertyList}" PARENT_SCOPE) endfunction() diff --git a/sources/Renderer/Metal/CMakeLists.txt b/sources/Renderer/Metal/CMakeLists.txt index f561465f2a..1aedb10922 100644 --- a/sources/Renderer/Metal/CMakeLists.txt +++ b/sources/Renderer/Metal/CMakeLists.txt @@ -61,7 +61,7 @@ if(LLGL_BUILD_RENDERER_METAL) add_llgl_module(LLGL_Metal LLGL_BUILD_RENDERER_METAL "${FilesMT}") if(LLGL_MOBILE_PLATFORM) - target_link_libraries(LLGL_Metal PUBLIC LLGL "-framework Foundation -framework UIKit -framework QuartzCore -framework Metal -framework MetalKit") + target_link_libraries(LLGL_Metal LLGL "-framework Foundation -framework UIKit -framework QuartzCore -framework Metal -framework MetalKit") else() target_link_libraries(LLGL_Metal LLGL ${METAL_LIBRARY} ${METALKIT_LIBRARY}) endif()