Skip to content

Commit

Permalink
Fix for MDEV-29925
Browse files Browse the repository at this point in the history
Since CHECK_COMPILER_FLAG doesn't work for linker flags,
we need to check the options with CHECK_LINKER_FLAG
(which is available since CMake 3.18)
  • Loading branch information
9EOR9 committed Nov 7, 2022
1 parent 9ca66a7 commit 44383e3
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions plugins/auth/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,10 @@ IF(NOT WIN32)
INCLUDE(${CC_SOURCE_DIR}/cmake/FindGSSAPI.cmake)
IF(GSSAPI_FOUND)
SET(GSSAPI_SOURCES ${AUTH_DIR}/auth_gssapi_client.c ${AUTH_DIR}/gssapi_client.c ${AUTH_DIR}/gssapi_errmsg.c)
CHECK_C_COMPILER_FLAG(-Wl,--as-needed have_C__Wl___as_needed)
IF (CMAKE_VERSION VERSION_GREATER 3.18)
INCLUDE(CheckLinkerFlag)
CHECK_LINKER_FLAG(C -Wl,--as-needed have__Wl___as_needed)
ENDIF()
ENDIF()
ELSE()
SET(GSSAPI_LIBS secur32)
Expand All @@ -116,7 +119,7 @@ IF(GSSAPI_SOURCES)
IF(CMAKE_C_COMPILER_ID MATCHES "Clang")
SET_SOURCE_FILES_PROPERTIES(${GSSAPI_SOURCES} PROPERTY COMPILE_FLAGS "-Wno-deprecated-declarations")
ENDIF()
IF(have_C__Wl___as_needed)
IF(have__Wl___as_needed)
SET_TARGET_PROPERTIES(auth_gssapi_client PROPERTIES LINK_FLAGS "-Wl,--as-needed")
ENDIF()
ENDIF()
Expand Down

0 comments on commit 44383e3

Please sign in to comment.