diff --git a/CMakeLists.txt b/CMakeLists.txt index 9529a1e4..289ffb06 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -28,7 +28,7 @@ set(CMAKE_CXX_STANDARD 23) if(APPLE) set(CMAKE_MACOSX_RPATH OFF) else() - if(UNIX) + if(UNIX AND NOT DEFINED BUILD_SHARED_LIBS) set(BUILD_SHARED_LIBS ON) endif() set(CMAKE_INSTALL_RPATH "$ORIGIN/../lib")