mirror of
https://github.com/baldurk/renderdoc.git
synced 2026-09-22 21:55:52 +00:00
Disallow the linker to ingore shared libraries during linking
In some cases when the renderdoccmd/qrenderdoc is linked the linker ignores the libEGL.so and only uses the librenderdoc.so. This is because the renderdoc shared library provides the same symbols as the libEGL.so. However we need to keep the libEGL.so as we are using RTLD_NEXT in the renderdoc shared library.
This commit is contained in:
committed by
Baldur Karlsson
parent
386c830b1d
commit
081f65dff1
@@ -96,6 +96,7 @@ win32 {
|
||||
} else {
|
||||
QT += x11extras
|
||||
DEFINES += RENDERDOC_PLATFORM_POSIX RENDERDOC_PLATFORM_LINUX RENDERDOC_WINDOWING_XLIB RENDERDOC_WINDOWING_XCB
|
||||
QMAKE_LFLAGS += '-Wl,--no-as-needed'
|
||||
|
||||
contains(QMAKE_CXXFLAGS, "-DRENDERDOC_SUPPORT_GL") {
|
||||
# Link against GL
|
||||
|
||||
@@ -8,6 +8,7 @@ elseif(ANDROID)
|
||||
list(APPEND sources renderdoccmd_android.cpp)
|
||||
include_directories(${ANDROID_NDK}/sources/android/native_app_glue)
|
||||
list(APPEND libraries PRIVATE -llog -landroid)
|
||||
set(LINKER_FLAGS "-Wl,--no-as-needed")
|
||||
elseif(UNIX)
|
||||
list(APPEND sources renderdoccmd_linux.cpp)
|
||||
|
||||
@@ -32,14 +33,20 @@ elseif(UNIX)
|
||||
if(ENABLE_XLIB AND ENABLE_XCB)
|
||||
list(APPEND libraries PRIVATE -lX11-xcb)
|
||||
endif()
|
||||
|
||||
# Make sure that for the target executable we don't throw away
|
||||
# any shared libraries.
|
||||
set(LINKER_FLAGS "-Wl,--no-as-needed")
|
||||
endif()
|
||||
|
||||
if(ANDROID)
|
||||
set(CMAKE_SHARED_LINKER_FLAGS "${LINKER_FLAGS}")
|
||||
add_library(renderdoccmd SHARED ${sources})
|
||||
else()
|
||||
set(CMAKE_SKIP_BUILD_RPATH TRUE)
|
||||
set(CMAKE_BUILD_WITH_INSTALL_RPATH TRUE)
|
||||
set(CMAKE_INSTALL_RPATH "$ORIGIN/:$ORIGIN/../lib/")
|
||||
set(CMAKE_EXE_LINKER_FLAGS "${LINKER_FLAGS}")
|
||||
|
||||
add_executable(renderdoccmd ${sources})
|
||||
endif()
|
||||
|
||||
Reference in New Issue
Block a user