diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index 7190ba389..05dc7c683 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -1189,11 +1189,10 @@ if(WIN32) target_link_libraries(strawberry_lib PRIVATE dsound) endif(WIN32) -if(UNIX AND NOT APPLE) +if(X11_FOUND) # Hack: the Gold linker pays attention to the order that libraries are specified on the link line. # -lX11 and -ldl are provided earlier in the link command but they're actually used by libraries that appear after them, so they end up getting ignored. # This appends them to the very end of the link line, ensuring they're always used. - find_package(X11) if(FREEBSD) target_link_libraries(strawberry_lib PRIVATE ${X11_X11_LIB}) else()