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