From 9a6c67f367f20114719f928e9ae8c68b417b9b03 Mon Sep 17 00:00:00 2001 From: Cacodemon345 Date: Fri, 3 Dec 2021 16:42:31 +0600 Subject: [PATCH 1/3] Fix linker errors on macOS --- src/qt/CMakeLists.txt | 34 ++++++++++++++++++---------------- 1 file changed, 18 insertions(+), 16 deletions(-) diff --git a/src/qt/CMakeLists.txt b/src/qt/CMakeLists.txt index 0e1193a69..df00381ed 100644 --- a/src/qt/CMakeLists.txt +++ b/src/qt/CMakeLists.txt @@ -102,25 +102,27 @@ target_link_libraries( Threads::Threads ) -if (UNIX AND NOT APPLE) - find_package(X11 REQUIRED) - target_link_libraries(ui PRIVATE X11::X11) - find_package(ECM NO_MODULE) - if (PkgConfig_FOUND) - pkg_check_modules(RTMIDI rtmidi) - if (RTMIDI_FOUND) - target_include_directories(plat PRIVATE ${RTMIDI_INCLUDE_DIRS}) - target_link_directories(plat PRIVATE ${RTMIDI_LIBRARY_DIRS}) - target_link_libraries(plat PRIVATE ${RTMIDI_LIBRARIES}) - target_link_options(plat PRIVATE ${RTMIDI_LDFLAGS}) - target_compile_options(plat PRIVATE ${RTMIDI_CFLAGS}) - target_sources(plat PRIVATE rtmidi_midi.cpp) - else() - target_sources(plat PRIVATE qt_midi.cpp) - endif() +if (PkgConfig_FOUND) + pkg_check_modules(RTMIDI rtmidi) + if (RTMIDI_FOUND) + target_include_directories(plat PRIVATE ${RTMIDI_INCLUDE_DIRS}) + target_link_directories(plat PRIVATE ${RTMIDI_LIBRARY_DIRS}) + target_link_libraries(plat PRIVATE ${RTMIDI_LIBRARIES}) + target_link_options(plat PRIVATE ${RTMIDI_LDFLAGS}) + target_compile_options(plat PRIVATE ${RTMIDI_CFLAGS}) + target_sources(plat PRIVATE rtmidi_midi.cpp) else() target_sources(plat PRIVATE qt_midi.cpp) endif() +else() + target_sources(plat PRIVATE qt_midi.cpp) +endif() + +if (UNIX AND NOT APPLE) + find_package(X11 REQUIRED) + target_link_libraries(ui PRIVATE X11::X11) + + find_package(ECM NO_MODULE) if (ECM_FOUND) list(APPEND CMAKE_MODULE_PATH ${ECM_MODULE_PATH}) find_package(Wayland COMPONENTS Client) From 22be61c09ac20f51905535309bb9fbd047db09f7 Mon Sep 17 00:00:00 2001 From: Cacodemon345 Date: Fri, 3 Dec 2021 18:28:05 +0600 Subject: [PATCH 2/3] Avoid setting RtMidi flags --- src/qt/CMakeLists.txt | 2 -- 1 file changed, 2 deletions(-) diff --git a/src/qt/CMakeLists.txt b/src/qt/CMakeLists.txt index df00381ed..d18841b57 100644 --- a/src/qt/CMakeLists.txt +++ b/src/qt/CMakeLists.txt @@ -108,8 +108,6 @@ if (PkgConfig_FOUND) target_include_directories(plat PRIVATE ${RTMIDI_INCLUDE_DIRS}) target_link_directories(plat PRIVATE ${RTMIDI_LIBRARY_DIRS}) target_link_libraries(plat PRIVATE ${RTMIDI_LIBRARIES}) - target_link_options(plat PRIVATE ${RTMIDI_LDFLAGS}) - target_compile_options(plat PRIVATE ${RTMIDI_CFLAGS}) target_sources(plat PRIVATE rtmidi_midi.cpp) else() target_sources(plat PRIVATE qt_midi.cpp) From 0a10cd10d6cd8a0b74d604d232f038ef0ed75f96 Mon Sep 17 00:00:00 2001 From: Cacodemon345 Date: Fri, 3 Dec 2021 19:43:10 +0600 Subject: [PATCH 3/3] Fix linking for real --- src/qt/CMakeLists.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/qt/CMakeLists.txt b/src/qt/CMakeLists.txt index d18841b57..4dd075e34 100644 --- a/src/qt/CMakeLists.txt +++ b/src/qt/CMakeLists.txt @@ -106,7 +106,7 @@ if (PkgConfig_FOUND) pkg_check_modules(RTMIDI rtmidi) if (RTMIDI_FOUND) target_include_directories(plat PRIVATE ${RTMIDI_INCLUDE_DIRS}) - target_link_directories(plat PRIVATE ${RTMIDI_LIBRARY_DIRS}) + target_link_directories(plat INTERFACE ${RTMIDI_LIBRARY_DIRS}) target_link_libraries(plat PRIVATE ${RTMIDI_LIBRARIES}) target_sources(plat PRIVATE rtmidi_midi.cpp) else()