From 7c126f9010b6bfd7bf968659807ba73e39b31173 Mon Sep 17 00:00:00 2001 From: Bret Brown Date: Sat, 25 Jan 2025 21:42:11 +0000 Subject: [PATCH] Support BUILD_SHARED_LIBS ## Problem Hardcoding STATIC is unneeded and breaks support for the standard CMake feature `BUILD_SHARED_LIBS`. ## Solution Remove `STATIC` from the `add_library(exemplar)` statement and allow CMake defaults to provide a default static library build. ## Reference For `add_library` supporting `BUILD_SHARED_LIBS`: https://cmake.org/cmake/help/latest/command/add_library.html Docs for `BUILD_SHARED_LIBS`, including that `STATIC` is the default for CMake built libraries. https://cmake.org/cmake/help/latest/variable/BUILD_SHARED_LIBS.html#variable:BUILD_SHARED_LIBS --- src/beman/exemplar/CMakeLists.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/beman/exemplar/CMakeLists.txt b/src/beman/exemplar/CMakeLists.txt index edee25c..0a40521 100644 --- a/src/beman/exemplar/CMakeLists.txt +++ b/src/beman/exemplar/CMakeLists.txt @@ -1,6 +1,6 @@ # SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception -add_library(beman.exemplar STATIC) +add_library(beman.exemplar) add_library(beman::exemplar ALIAS beman.exemplar) target_sources(beman.exemplar PRIVATE identity.cpp)