diff --git a/external/qt/CMakeLists.txt b/external/qt/CMakeLists.txt index c877682..2635442 100644 --- a/external/qt/CMakeLists.txt +++ b/external/qt/CMakeLists.txt @@ -276,29 +276,6 @@ else() INTERFACE ${qt_loc}/mkspecs/linux-g++ ) - target_link_options(external_qt - INTERFACE - -static-libstdc++ - -pthread - -rdynamic - ) - if (DESKTOP_APP_USE_ALLOCATION_TRACER) - target_link_options(external_qt - INTERFACE - # -Wl,-wrap,__malloc - -Wl,-wrap,__libc_malloc - -Wl,-wrap,malloc - -Wl,-wrap,valloc - -Wl,-wrap,pvalloc - -Wl,-wrap,calloc - -Wl,-wrap,realloc - -Wl,-wrap,memalign - -Wl,-wrap,aligned_alloc - -Wl,-wrap,posix_memalign - -Wl,-wrap,free - -Wl,--no-as-needed,-lrt - ) - endif() target_link_static_libraries(external_qt INTERFACE proxy @@ -320,13 +297,6 @@ else() xcb-render-util xcb-keysyms ) - if (DESKTOP_APP_USE_ALLOCATION_TRACER) - target_link_libraries(external_qt - INTERFACE - desktop-app::linux_allocation_tracer - $ - ) - endif() if (Qt5WaylandClient_FOUND) target_link_libraries(external_qt INTERFACE diff --git a/linux_allocation_tracer/CMakeLists.txt b/linux_allocation_tracer/CMakeLists.txt index ea8c3cc..ddac091 100644 --- a/linux_allocation_tracer/CMakeLists.txt +++ b/linux_allocation_tracer/CMakeLists.txt @@ -21,6 +21,4 @@ PRIVATE linux_allocation_trace_reader.cpp ) -target_link_options(allocation_trace_reader PRIVATE -static-libstdc++) - set_target_properties(allocation_trace_reader PROPERTIES RUNTIME_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}) diff --git a/options_linux.cmake b/options_linux.cmake index cfae65b..570f10f 100644 --- a/options_linux.cmake +++ b/options_linux.cmake @@ -50,6 +50,38 @@ INTERFACE desktop-app::external_jemalloc ) +if (DESKTOP_APP_USE_ALLOCATION_TRACER) + target_link_options(common_options + INTERFACE + # -Wl,-wrap,__malloc + -Wl,-wrap,__libc_malloc + -Wl,-wrap,malloc + -Wl,-wrap,valloc + -Wl,-wrap,pvalloc + -Wl,-wrap,calloc + -Wl,-wrap,realloc + -Wl,-wrap,memalign + -Wl,-wrap,aligned_alloc + -Wl,-wrap,posix_memalign + -Wl,-wrap,free + -Wl,--no-as-needed,-lrt + ) + target_link_libraries(common_options + INTERFACE + desktop-app::linux_allocation_tracer + $ + ) +endif() + +if (NOT DESKTOP_APP_USE_PACKAGED) + target_link_options(common_options + INTERFACE + -static-libstdc++ + -pthread + -rdynamic + ) +endif() + if (DESKTOP_APP_USE_PACKAGED) find_library(ATOMIC_LIBRARY atomic) else()