From c238f733faa828c9efc9edb6f2dbc6888ef6ce49 Mon Sep 17 00:00:00 2001 From: Chris Robinson Date: Mon, 2 Dec 2024 18:10:12 -0800 Subject: [PATCH] Don't link fmt-header-only directly when building a static lib --- CMakeLists.txt | 11 ++++++++++- fmt-11.0.2/CMakeLists.txt | 4 ---- 2 files changed, 10 insertions(+), 5 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 250eaeff79..4c25933319 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -1371,7 +1371,16 @@ add_custom_target(clang-tidy-check ${CLANG_TIDY_EXECUTABLE} -format-style=file - if(LIBTYPE STREQUAL "STATIC") add_library(${IMPL_TARGET} STATIC ${COMMON_OBJS} ${OPENAL_OBJS} ${ALC_OBJS} ${CORE_OBJS}) target_compile_definitions(${IMPL_TARGET} PUBLIC AL_LIBTYPE_STATIC) - target_link_libraries(${IMPL_TARGET} PRIVATE ${LINKER_FLAGS} ${EXTRA_LIBS} ${MATH_LIB} alsoft::fmt-header-only) + # Instead of "linking" with the fmt-header-only interface target, which + # puts an unwanted dependency on the target when exporting/installing, just + # copy the properties. + target_compile_definitions(${IMPL_TARGET} PRIVATE + $) + target_include_directories(${IMPL_TARGET} PRIVATE + $) + target_compile_options(${IMPL_TARGET} PRIVATE + $) + target_link_libraries(${IMPL_TARGET} PRIVATE ${LINKER_FLAGS} ${EXTRA_LIBS} ${MATH_LIB}) if(WIN32) # This option is for static linking OpenAL Soft into another project diff --git a/fmt-11.0.2/CMakeLists.txt b/fmt-11.0.2/CMakeLists.txt index b30d7c106e..480ef5c369 100644 --- a/fmt-11.0.2/CMakeLists.txt +++ b/fmt-11.0.2/CMakeLists.txt @@ -94,10 +94,6 @@ set_target_properties(alsoft.fmt PROPERTIES ${ALSOFT_STD_VERSION_PROPS} COMPILE_PDB_NAME "fmt" COMPILE_PDB_NAME_DEBUG "fmt${ALSOFT_FMT_DEBUG_POSTFIX}") -if (BUILD_SHARED_LIBS) - target_compile_definitions(alsoft.fmt PRIVATE FMT_LIB_EXPORT INTERFACE FMT_SHARED) -endif () - add_library(alsoft.fmt-header-only INTERFACE) add_library(alsoft::fmt-header-only ALIAS alsoft.fmt-header-only)