CMake: Add missing BUILD_SHARED_LIBS option

This commit is contained in:
mj-xmr 2022-04-02 16:19:57 +02:00
parent f49fc9b487
commit 9c42b728ba
No known key found for this signature in database
GPG Key ID: C101BF94093451E0

View File

@ -472,9 +472,11 @@ endif()
option(STATIC "Link libraries statically" ${DEFAULT_STATIC}) option(STATIC "Link libraries statically" ${DEFAULT_STATIC})
# This is a CMake built-in switch that concerns internal libraries # This is a CMake built-in switch that concerns internal libraries
if (NOT DEFINED BUILD_SHARED_LIBS AND NOT STATIC AND CMAKE_BUILD_TYPE_LOWER STREQUAL "debug") set(BUILD_SHARED_LIBS_DEFAULT OFF)
set(BUILD_SHARED_LIBS ON) if (NOT STATIC AND CMAKE_BUILD_TYPE_LOWER STREQUAL "debug")
set(BUILD_SHARED_LIBS_DEFAULT ON)
endif() endif()
option(BUILD_SHARED_LIBS "Build internal libraries as shared" ${BUILD_SHARED_LIBS_DEFAULT})
if (BUILD_SHARED_LIBS) if (BUILD_SHARED_LIBS)
message(STATUS "Building internal libraries with position independent code") message(STATUS "Building internal libraries with position independent code")