Skip to content

Commit 675f41b

Browse files
committed
Core (Build): Add opt-out option for performing unresolved symbol checks when linking SOs.
1 parent cf12f9d commit 675f41b

File tree

2 files changed

+7
-2
lines changed

2 files changed

+7
-2
lines changed

libvisual/CMakeLists.txt

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -134,6 +134,9 @@ IF(IS_SYSTEM_DIR STREQUAL "-1")
134134
SET(CMAKE_INSTALL_RPATH "${CMAKE_INSTALL_FULL_LIBDIR}")
135135
ENDIF()
136136

137+
# Resolve all external symbols when linking SOs.
138+
OPTION(ENABLE_SO_UNRESOLVED_SYMBOL_CHECKS "Enable resolution of external symbols when linking SOs" yes)
139+
137140
# Compiler optimizations
138141
OPTION(ENABLE_EXTRA_OPTIMIZATIONS "Enable extra optimizations" no)
139142
IF(ENABLE_EXTRA_OPTIMIZATIONS)

libvisual/libvisual/CMakeLists.txt

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -150,8 +150,6 @@ SET_TARGET_PROPERTIES(libvisual
150150

151151
TARGET_COMPILE_OPTIONS(libvisual PRIVATE -fvisibility=hidden)
152152

153-
TARGET_LINK_OPTIONS(libvisual PRIVATE -Wl,--no-undefined)
154-
155153
IF(ENABLE_TESTS)
156154
TARGET_COMPILE_DEFINITIONS(libvisual PRIVATE _LV_BUILD_PRIVATE_TEST_FUNCS)
157155
ENDIF()
@@ -165,6 +163,10 @@ TARGET_INCLUDE_DIRECTORIES(libvisual
165163
${CMAKE_CURRENT_BINARY_DIR}
166164
)
167165

166+
IF(ENABLE_SO_UNRESOLVED_SYMBOL_CHECKS)
167+
TARGET_LINK_OPTIONS(libvisual PRIVATE -Wl,--no-undefined)
168+
ENDIF()
169+
168170
TARGET_LINK_LIBRARIES(libvisual
169171
PRIVATE
170172
PkgConfig::ORC

0 commit comments

Comments
 (0)