From 3615ca70b112576b19a812b0c79a036375956a4e Mon Sep 17 00:00:00 2001 From: Dale Glass Date: Wed, 26 Aug 2020 00:40:20 +0200 Subject: [PATCH] Fix build of hifiSdl2 on GCC 10 GCC 10 and above sets -fno-common by default, and causes a linking problem here: ultiple definition of `WAYLAND_wl_proxy_marshal' Work around it per https://medium.com/@clentfort/using-esy-sdl2-with-gcc-10-91b4fa0c5aa9 --- plugins/hifiSdl2/CMakeLists.txt | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/plugins/hifiSdl2/CMakeLists.txt b/plugins/hifiSdl2/CMakeLists.txt index c68723a10a..e1f0ee28d8 100644 --- a/plugins/hifiSdl2/CMakeLists.txt +++ b/plugins/hifiSdl2/CMakeLists.txt @@ -8,7 +8,14 @@ if (NOT APPLE) set(TARGET_NAME hifiSdl2) + if (CMAKE_COMPILER_IS_GNUCC AND CMAKE_CXX_COMPILER_VERSION VERSION_GREATER 10.0) + # GCC 10 and above sets -fno-common by default, and causes a linking problem here: + # multiple definition of `WAYLAND_wl_proxy_marshal' + # + # Work around it per https://medium.com/@clentfort/using-esy-sdl2-with-gcc-10-91b4fa0c5aa9 + link_libraries("-Wl,--allow-multiple-definition") + endif() setup_hifi_plugin(Qml) link_hifi_libraries(shared controllers ui plugins input-plugins script-engine) target_sdl2() -endif() \ No newline at end of file +endif()