From 0399b6b6bbab62d6e06e95f7f99bc0460942fcb9 Mon Sep 17 00:00:00 2001 From: Jean-Pierre De Jesus DIAZ Date: Mon, 29 May 2023 14:09:58 +0200 Subject: [PATCH 1/2] Allow using system libfmt Signed-off-by: Jean-Pierre De Jesus DIAZ --- CMakeLists.txt | 5 +++-- cmake/fmt.cmake | 14 ++++++++++++++ src/3rdparty/CL/{ => CL}/LICENSE | 0 src/3rdparty/CL/{ => CL}/README.md | 0 src/3rdparty/CL/{ => CL}/cl.h | 0 src/3rdparty/CL/{ => CL}/cl_d3d10.h | 0 src/3rdparty/CL/{ => CL}/cl_d3d11.h | 0 src/3rdparty/CL/{ => CL}/cl_dx9_media_sharing.h | 0 .../CL/{ => CL}/cl_dx9_media_sharing_intel.h | 0 src/3rdparty/CL/{ => CL}/cl_egl.h | 0 src/3rdparty/CL/{ => CL}/cl_ext.h | 0 src/3rdparty/CL/{ => CL}/cl_ext_intel.h | 0 src/3rdparty/CL/{ => CL}/cl_gl.h | 0 src/3rdparty/CL/{ => CL}/cl_gl_ext.h | 0 src/3rdparty/CL/{ => CL}/cl_platform.h | 0 .../CL/{ => CL}/cl_va_api_media_sharing_intel.h | 0 src/3rdparty/CL/{ => CL}/cl_version.h | 0 src/3rdparty/CL/{ => CL}/opencl.h | 0 src/3rdparty/cl.h | 2 +- src/3rdparty/fmt/{ => fmt}/LICENSE.rst | 0 src/3rdparty/fmt/{ => fmt}/README.rst | 0 src/3rdparty/fmt/{ => fmt}/chrono.h | 0 src/3rdparty/fmt/{ => fmt}/color.h | 0 src/3rdparty/fmt/{ => fmt}/compile.h | 0 src/3rdparty/fmt/{ => fmt}/core.h | 0 src/3rdparty/fmt/{ => fmt}/format-inl.h | 0 src/3rdparty/fmt/{ => fmt}/format.cc | 2 +- src/3rdparty/fmt/{ => fmt}/format.h | 0 src/3rdparty/fmt/{ => fmt}/locale.h | 0 src/3rdparty/fmt/{ => fmt}/os.cc | 0 src/3rdparty/fmt/{ => fmt}/os.h | 0 src/3rdparty/fmt/{ => fmt}/ostream.h | 0 src/3rdparty/fmt/{ => fmt}/posix.h | 0 src/3rdparty/fmt/{ => fmt}/printf.h | 0 src/3rdparty/fmt/{ => fmt}/ranges.h | 0 src/backend/cpu/platform/lscpu_arm.cpp | 2 +- src/backend/opencl/wrappers/AdlLib_linux.cpp | 2 +- src/base/base.cmake | 1 - src/base/kernel/Process.cpp | 2 +- src/base/net/stratum/BaseClient.cpp | 3 ++- src/base/net/stratum/benchmark/BenchClient.cpp | 3 ++- src/base/net/stratum/benchmark/BenchConfig.cpp | 2 +- src/crypto/common/LinuxMemory.cpp | 2 +- src/hw/dmi/DmiMemory.cpp | 2 +- src/hw/dmi/DmiReader.cpp | 3 ++- src/hw/msr/Msr_linux.cpp | 2 +- 46 files changed, 32 insertions(+), 15 deletions(-) create mode 100644 cmake/fmt.cmake rename src/3rdparty/CL/{ => CL}/LICENSE (100%) rename src/3rdparty/CL/{ => CL}/README.md (100%) rename src/3rdparty/CL/{ => CL}/cl.h (100%) rename src/3rdparty/CL/{ => CL}/cl_d3d10.h (100%) rename src/3rdparty/CL/{ => CL}/cl_d3d11.h (100%) rename src/3rdparty/CL/{ => CL}/cl_dx9_media_sharing.h (100%) rename src/3rdparty/CL/{ => CL}/cl_dx9_media_sharing_intel.h (100%) rename src/3rdparty/CL/{ => CL}/cl_egl.h (100%) rename src/3rdparty/CL/{ => CL}/cl_ext.h (100%) rename src/3rdparty/CL/{ => CL}/cl_ext_intel.h (100%) rename src/3rdparty/CL/{ => CL}/cl_gl.h (100%) rename src/3rdparty/CL/{ => CL}/cl_gl_ext.h (100%) rename src/3rdparty/CL/{ => CL}/cl_platform.h (100%) rename src/3rdparty/CL/{ => CL}/cl_va_api_media_sharing_intel.h (100%) rename src/3rdparty/CL/{ => CL}/cl_version.h (100%) rename src/3rdparty/CL/{ => CL}/opencl.h (100%) rename src/3rdparty/fmt/{ => fmt}/LICENSE.rst (100%) rename src/3rdparty/fmt/{ => fmt}/README.rst (100%) rename src/3rdparty/fmt/{ => fmt}/chrono.h (100%) rename src/3rdparty/fmt/{ => fmt}/color.h (100%) rename src/3rdparty/fmt/{ => fmt}/compile.h (100%) rename src/3rdparty/fmt/{ => fmt}/core.h (100%) rename src/3rdparty/fmt/{ => fmt}/format-inl.h (100%) rename src/3rdparty/fmt/{ => fmt}/format.cc (98%) rename src/3rdparty/fmt/{ => fmt}/format.h (100%) rename src/3rdparty/fmt/{ => fmt}/locale.h (100%) rename src/3rdparty/fmt/{ => fmt}/os.cc (100%) rename src/3rdparty/fmt/{ => fmt}/os.h (100%) rename src/3rdparty/fmt/{ => fmt}/ostream.h (100%) rename src/3rdparty/fmt/{ => fmt}/posix.h (100%) rename src/3rdparty/fmt/{ => fmt}/printf.h (100%) rename src/3rdparty/fmt/{ => fmt}/ranges.h (100%) diff --git a/CMakeLists.txt b/CMakeLists.txt index a44e672b..782f274b 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -197,6 +197,7 @@ add_definitions(-D__STDC_FORMAT_MACROS -DUNICODE -D_FILE_OFFSET_BITS=64) find_package(UV REQUIRED) include(cmake/flags.cmake) +include(cmake/fmt.cmake) include(cmake/randomx.cmake) include(cmake/argon2.cmake) include(cmake/kawpow.cmake) @@ -228,7 +229,7 @@ include(src/hw/api/api.cmake) include(src/hw/dmi/dmi.cmake) include_directories(src) -include_directories(src/3rdparty) +include_directories(src/3rdparty/CL) include_directories(${UV_INCLUDE_DIR}) if (WITH_DEBUG_LOG) @@ -236,7 +237,7 @@ if (WITH_DEBUG_LOG) endif() add_executable(${CMAKE_PROJECT_NAME} ${HEADERS} ${SOURCES} ${SOURCES_OS} ${HEADERS_CRYPTO} ${SOURCES_CRYPTO} ${SOURCES_SYSLOG} ${TLS_SOURCES} ${XMRIG_ASM_SOURCES}) -target_link_libraries(${CMAKE_PROJECT_NAME} ${XMRIG_ASM_LIBRARY} ${OPENSSL_LIBRARIES} ${UV_LIBRARIES} ${EXTRA_LIBS} ${CPUID_LIB} ${ARGON2_LIBRARY} ${ETHASH_LIBRARY} ${GHOSTRIDER_LIBRARY}) +target_link_libraries(${CMAKE_PROJECT_NAME} ${XMRIG_ASM_LIBRARY} ${OPENSSL_LIBRARIES} ${UV_LIBRARIES} ${EXTRA_LIBS} ${CPUID_LIB} ${ARGON2_LIBRARY} ${ETHASH_LIBRARY} ${GHOSTRIDER_LIBRARY} ${FMT_LIBRARY}) if (WIN32) add_custom_command(TARGET ${CMAKE_PROJECT_NAME} POST_BUILD COMMAND ${CMAKE_COMMAND} -E copy_if_different "${CMAKE_SOURCE_DIR}/bin/WinRing0/WinRing0x64.sys" $) diff --git a/cmake/fmt.cmake b/cmake/fmt.cmake new file mode 100644 index 00000000..91210752 --- /dev/null +++ b/cmake/fmt.cmake @@ -0,0 +1,14 @@ +# SPDX-FileCopyrightText: © 2023 Jean-Pierre De Jesus DIAZ +# SPDX-License-Identifier: GPL-3.0-or-later + +find_package(fmt QUIET) + +if(fmt_FOUND) + set(FMT_LIBRARY fmt::fmt) +else() + message(STATUS "Using bundled fmt library") + add_library(fmt INTERFACE) + target_sources(fmt INTERFACE ${CMAKE_CURRENT_SOURCE_DIR}/src/3rdparty/fmt/format.cc) + target_include_directories(fmt INTERFACE ${CMAKE_CURRENT_SOURCE_DIR}/src/3rdparty/fmt) + set(FMT_LIBRARY fmt) +endif() diff --git a/src/3rdparty/CL/LICENSE b/src/3rdparty/CL/CL/LICENSE similarity index 100% rename from src/3rdparty/CL/LICENSE rename to src/3rdparty/CL/CL/LICENSE diff --git a/src/3rdparty/CL/README.md b/src/3rdparty/CL/CL/README.md similarity index 100% rename from src/3rdparty/CL/README.md rename to src/3rdparty/CL/CL/README.md diff --git a/src/3rdparty/CL/cl.h b/src/3rdparty/CL/CL/cl.h similarity index 100% rename from src/3rdparty/CL/cl.h rename to src/3rdparty/CL/CL/cl.h diff --git a/src/3rdparty/CL/cl_d3d10.h b/src/3rdparty/CL/CL/cl_d3d10.h similarity index 100% rename from src/3rdparty/CL/cl_d3d10.h rename to src/3rdparty/CL/CL/cl_d3d10.h diff --git a/src/3rdparty/CL/cl_d3d11.h b/src/3rdparty/CL/CL/cl_d3d11.h similarity index 100% rename from src/3rdparty/CL/cl_d3d11.h rename to src/3rdparty/CL/CL/cl_d3d11.h diff --git a/src/3rdparty/CL/cl_dx9_media_sharing.h b/src/3rdparty/CL/CL/cl_dx9_media_sharing.h similarity index 100% rename from src/3rdparty/CL/cl_dx9_media_sharing.h rename to src/3rdparty/CL/CL/cl_dx9_media_sharing.h diff --git a/src/3rdparty/CL/cl_dx9_media_sharing_intel.h b/src/3rdparty/CL/CL/cl_dx9_media_sharing_intel.h similarity index 100% rename from src/3rdparty/CL/cl_dx9_media_sharing_intel.h rename to src/3rdparty/CL/CL/cl_dx9_media_sharing_intel.h diff --git a/src/3rdparty/CL/cl_egl.h b/src/3rdparty/CL/CL/cl_egl.h similarity index 100% rename from src/3rdparty/CL/cl_egl.h rename to src/3rdparty/CL/CL/cl_egl.h diff --git a/src/3rdparty/CL/cl_ext.h b/src/3rdparty/CL/CL/cl_ext.h similarity index 100% rename from src/3rdparty/CL/cl_ext.h rename to src/3rdparty/CL/CL/cl_ext.h diff --git a/src/3rdparty/CL/cl_ext_intel.h b/src/3rdparty/CL/CL/cl_ext_intel.h similarity index 100% rename from src/3rdparty/CL/cl_ext_intel.h rename to src/3rdparty/CL/CL/cl_ext_intel.h diff --git a/src/3rdparty/CL/cl_gl.h b/src/3rdparty/CL/CL/cl_gl.h similarity index 100% rename from src/3rdparty/CL/cl_gl.h rename to src/3rdparty/CL/CL/cl_gl.h diff --git a/src/3rdparty/CL/cl_gl_ext.h b/src/3rdparty/CL/CL/cl_gl_ext.h similarity index 100% rename from src/3rdparty/CL/cl_gl_ext.h rename to src/3rdparty/CL/CL/cl_gl_ext.h diff --git a/src/3rdparty/CL/cl_platform.h b/src/3rdparty/CL/CL/cl_platform.h similarity index 100% rename from src/3rdparty/CL/cl_platform.h rename to src/3rdparty/CL/CL/cl_platform.h diff --git a/src/3rdparty/CL/cl_va_api_media_sharing_intel.h b/src/3rdparty/CL/CL/cl_va_api_media_sharing_intel.h similarity index 100% rename from src/3rdparty/CL/cl_va_api_media_sharing_intel.h rename to src/3rdparty/CL/CL/cl_va_api_media_sharing_intel.h diff --git a/src/3rdparty/CL/cl_version.h b/src/3rdparty/CL/CL/cl_version.h similarity index 100% rename from src/3rdparty/CL/cl_version.h rename to src/3rdparty/CL/CL/cl_version.h diff --git a/src/3rdparty/CL/opencl.h b/src/3rdparty/CL/CL/opencl.h similarity index 100% rename from src/3rdparty/CL/opencl.h rename to src/3rdparty/CL/CL/opencl.h diff --git a/src/3rdparty/cl.h b/src/3rdparty/cl.h index bd9a46d0..3643dadc 100644 --- a/src/3rdparty/cl.h +++ b/src/3rdparty/cl.h @@ -29,7 +29,7 @@ #if defined(__APPLE__) # include #else -# include "3rdparty/CL/cl.h" +# include #endif diff --git a/src/3rdparty/fmt/LICENSE.rst b/src/3rdparty/fmt/fmt/LICENSE.rst similarity index 100% rename from src/3rdparty/fmt/LICENSE.rst rename to src/3rdparty/fmt/fmt/LICENSE.rst diff --git a/src/3rdparty/fmt/README.rst b/src/3rdparty/fmt/fmt/README.rst similarity index 100% rename from src/3rdparty/fmt/README.rst rename to src/3rdparty/fmt/fmt/README.rst diff --git a/src/3rdparty/fmt/chrono.h b/src/3rdparty/fmt/fmt/chrono.h similarity index 100% rename from src/3rdparty/fmt/chrono.h rename to src/3rdparty/fmt/fmt/chrono.h diff --git a/src/3rdparty/fmt/color.h b/src/3rdparty/fmt/fmt/color.h similarity index 100% rename from src/3rdparty/fmt/color.h rename to src/3rdparty/fmt/fmt/color.h diff --git a/src/3rdparty/fmt/compile.h b/src/3rdparty/fmt/fmt/compile.h similarity index 100% rename from src/3rdparty/fmt/compile.h rename to src/3rdparty/fmt/fmt/compile.h diff --git a/src/3rdparty/fmt/core.h b/src/3rdparty/fmt/fmt/core.h similarity index 100% rename from src/3rdparty/fmt/core.h rename to src/3rdparty/fmt/fmt/core.h diff --git a/src/3rdparty/fmt/format-inl.h b/src/3rdparty/fmt/fmt/format-inl.h similarity index 100% rename from src/3rdparty/fmt/format-inl.h rename to src/3rdparty/fmt/fmt/format-inl.h diff --git a/src/3rdparty/fmt/format.cc b/src/3rdparty/fmt/fmt/format.cc similarity index 98% rename from src/3rdparty/fmt/format.cc rename to src/3rdparty/fmt/fmt/format.cc index 52806fd7..a64a1f38 100644 --- a/src/3rdparty/fmt/format.cc +++ b/src/3rdparty/fmt/fmt/format.cc @@ -5,7 +5,7 @@ // // For the license information refer to format.h. -#include "3rdparty/fmt/format-inl.h" +#include "fmt/format-inl.h" FMT_BEGIN_NAMESPACE namespace detail { diff --git a/src/3rdparty/fmt/format.h b/src/3rdparty/fmt/fmt/format.h similarity index 100% rename from src/3rdparty/fmt/format.h rename to src/3rdparty/fmt/fmt/format.h diff --git a/src/3rdparty/fmt/locale.h b/src/3rdparty/fmt/fmt/locale.h similarity index 100% rename from src/3rdparty/fmt/locale.h rename to src/3rdparty/fmt/fmt/locale.h diff --git a/src/3rdparty/fmt/os.cc b/src/3rdparty/fmt/fmt/os.cc similarity index 100% rename from src/3rdparty/fmt/os.cc rename to src/3rdparty/fmt/fmt/os.cc diff --git a/src/3rdparty/fmt/os.h b/src/3rdparty/fmt/fmt/os.h similarity index 100% rename from src/3rdparty/fmt/os.h rename to src/3rdparty/fmt/fmt/os.h diff --git a/src/3rdparty/fmt/ostream.h b/src/3rdparty/fmt/fmt/ostream.h similarity index 100% rename from src/3rdparty/fmt/ostream.h rename to src/3rdparty/fmt/fmt/ostream.h diff --git a/src/3rdparty/fmt/posix.h b/src/3rdparty/fmt/fmt/posix.h similarity index 100% rename from src/3rdparty/fmt/posix.h rename to src/3rdparty/fmt/fmt/posix.h diff --git a/src/3rdparty/fmt/printf.h b/src/3rdparty/fmt/fmt/printf.h similarity index 100% rename from src/3rdparty/fmt/printf.h rename to src/3rdparty/fmt/fmt/printf.h diff --git a/src/3rdparty/fmt/ranges.h b/src/3rdparty/fmt/fmt/ranges.h similarity index 100% rename from src/3rdparty/fmt/ranges.h rename to src/3rdparty/fmt/fmt/ranges.h diff --git a/src/backend/cpu/platform/lscpu_arm.cpp b/src/backend/cpu/platform/lscpu_arm.cpp index d632ac49..3df23a8a 100644 --- a/src/backend/cpu/platform/lscpu_arm.cpp +++ b/src/backend/cpu/platform/lscpu_arm.cpp @@ -19,11 +19,11 @@ #include "base/tools/String.h" -#include "3rdparty/fmt/core.h" #include #include +#include namespace xmrig { diff --git a/src/backend/opencl/wrappers/AdlLib_linux.cpp b/src/backend/opencl/wrappers/AdlLib_linux.cpp index 1f91a9bf..4b688533 100644 --- a/src/backend/opencl/wrappers/AdlLib_linux.cpp +++ b/src/backend/opencl/wrappers/AdlLib_linux.cpp @@ -20,7 +20,6 @@ #include "backend/opencl/wrappers/AdlLib.h" -#include "3rdparty/fmt/core.h" #include "backend/opencl/wrappers/OclDevice.h" @@ -31,6 +30,7 @@ #include #include #include +#include namespace xmrig { diff --git a/src/base/base.cmake b/src/base/base.cmake index 0f4f8725..a0c71af1 100644 --- a/src/base/base.cmake +++ b/src/base/base.cmake @@ -88,7 +88,6 @@ set(HEADERS_BASE ) set(SOURCES_BASE - src/3rdparty/fmt/format.cc src/base/crypto/Algorithm.cpp src/base/crypto/Coin.cpp src/base/crypto/keccak.cpp diff --git a/src/base/kernel/Process.cpp b/src/base/kernel/Process.cpp index 5e95e3c3..421683c4 100644 --- a/src/base/kernel/Process.cpp +++ b/src/base/kernel/Process.cpp @@ -22,10 +22,10 @@ #include "base/kernel/Process.h" -#include "3rdparty/fmt/core.h" #include "base/tools/Chrono.h" #include "version.h" +#include #ifdef XMRIG_OS_WIN # ifdef _MSC_VER diff --git a/src/base/net/stratum/BaseClient.cpp b/src/base/net/stratum/BaseClient.cpp index 7c9a728d..eb524189 100644 --- a/src/base/net/stratum/BaseClient.cpp +++ b/src/base/net/stratum/BaseClient.cpp @@ -17,7 +17,6 @@ */ #include "base/net/stratum/BaseClient.h" -#include "3rdparty/fmt/core.h" #include "3rdparty/rapidjson/document.h" #include "base/io/Env.h" #include "base/io/log/Log.h" @@ -25,6 +24,8 @@ #include "base/kernel/interfaces/IClientListener.h" #include "base/net/stratum/SubmitResult.h" +#include + namespace xmrig { diff --git a/src/base/net/stratum/benchmark/BenchClient.cpp b/src/base/net/stratum/benchmark/BenchClient.cpp index a9459e1f..ec706105 100644 --- a/src/base/net/stratum/benchmark/BenchClient.cpp +++ b/src/base/net/stratum/benchmark/BenchClient.cpp @@ -17,7 +17,6 @@ */ #include "base/net/stratum/benchmark/BenchClient.h" -#include "3rdparty/fmt/core.h" #include "3rdparty/rapidjson/document.h" #include "backend/common/benchmark/BenchState.h" #include "backend/common/interfaces/IBackend.h" @@ -39,6 +38,8 @@ # include "hw/dmi/DmiReader.h" #endif +#include + xmrig::BenchClient::BenchClient(const std::shared_ptr &benchmark, IClientListener* listener) : m_listener(listener), diff --git a/src/base/net/stratum/benchmark/BenchConfig.cpp b/src/base/net/stratum/benchmark/BenchConfig.cpp index b7acc07d..bda0c42d 100644 --- a/src/base/net/stratum/benchmark/BenchConfig.cpp +++ b/src/base/net/stratum/benchmark/BenchConfig.cpp @@ -17,12 +17,12 @@ */ #include "base/net/stratum/benchmark/BenchConfig.h" -#include "3rdparty/fmt/core.h" #include "3rdparty/rapidjson/document.h" #include "base/io/json/Json.h" #include +#include #ifdef _MSC_VER diff --git a/src/crypto/common/LinuxMemory.cpp b/src/crypto/common/LinuxMemory.cpp index 8a00e1c3..d45cdb05 100644 --- a/src/crypto/common/LinuxMemory.cpp +++ b/src/crypto/common/LinuxMemory.cpp @@ -17,12 +17,12 @@ */ #include "crypto/common/LinuxMemory.h" -#include "3rdparty/fmt/core.h" #include "crypto/common/VirtualMemory.h" #include #include +#include #include #include diff --git a/src/hw/dmi/DmiMemory.cpp b/src/hw/dmi/DmiMemory.cpp index a07f5b55..0e4d80b0 100644 --- a/src/hw/dmi/DmiMemory.cpp +++ b/src/hw/dmi/DmiMemory.cpp @@ -20,7 +20,6 @@ #include "hw/dmi/DmiMemory.h" -#include "3rdparty/fmt/format.h" #include "3rdparty/rapidjson/document.h" #include "hw/dmi/DmiTools.h" @@ -28,6 +27,7 @@ #include #include #include +#include namespace xmrig { diff --git a/src/hw/dmi/DmiReader.cpp b/src/hw/dmi/DmiReader.cpp index 1e12603c..261028eb 100644 --- a/src/hw/dmi/DmiReader.cpp +++ b/src/hw/dmi/DmiReader.cpp @@ -19,10 +19,11 @@ */ #include "hw/dmi/DmiReader.h" -#include "3rdparty/fmt/core.h" #include "3rdparty/rapidjson/document.h" #include "hw/dmi/DmiTools.h" +#include + namespace xmrig { diff --git a/src/hw/msr/Msr_linux.cpp b/src/hw/msr/Msr_linux.cpp index 29bb8ad1..6f598c3f 100644 --- a/src/hw/msr/Msr_linux.cpp +++ b/src/hw/msr/Msr_linux.cpp @@ -18,7 +18,6 @@ #include "hw/msr/Msr.h" -#include "3rdparty/fmt/core.h" #include "backend/cpu/Cpu.h" #include "base/io/log/Log.h" @@ -29,6 +28,7 @@ #include #include #include +#include #include #include #include From f0f6d1666c250e8b10fa274d9d4b19cc918eb80a Mon Sep 17 00:00:00 2001 From: Jean-Pierre De Jesus DIAZ Date: Mon, 29 May 2023 20:13:28 +0200 Subject: [PATCH 2/2] fixup! Allow using system libfmt --- CMakeLists.txt | 1 + cmake/fmt.cmake | 9 ++++----- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 782f274b..a8706b0d 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -32,6 +32,7 @@ option(WITH_VAES "Enable VAES instructions for Cryptonight" ON) option(WITH_BENCHMARK "Enable builtin RandomX benchmark and stress test" ON) option(WITH_SECURE_JIT "Enable secure access to JIT memory" OFF) option(WITH_DMI "Enable DMI/SMBIOS reader" ON) +option(WITH_BUNDLED_FMT "Force use of bundled fmt library" ON) option(BUILD_STATIC "Build static binary" OFF) option(ARM_TARGET "Force use specific ARM target 8 or 7" 0) diff --git a/cmake/fmt.cmake b/cmake/fmt.cmake index 91210752..21aaaf7f 100644 --- a/cmake/fmt.cmake +++ b/cmake/fmt.cmake @@ -1,14 +1,13 @@ # SPDX-FileCopyrightText: © 2023 Jean-Pierre De Jesus DIAZ # SPDX-License-Identifier: GPL-3.0-or-later -find_package(fmt QUIET) -if(fmt_FOUND) - set(FMT_LIBRARY fmt::fmt) -else() - message(STATUS "Using bundled fmt library") +if(WITH_BUNDLED_FMT) add_library(fmt INTERFACE) target_sources(fmt INTERFACE ${CMAKE_CURRENT_SOURCE_DIR}/src/3rdparty/fmt/format.cc) target_include_directories(fmt INTERFACE ${CMAKE_CURRENT_SOURCE_DIR}/src/3rdparty/fmt) +else() set(FMT_LIBRARY fmt) + find_package(fmt REQUIRED) + set(FMT_LIBRARY fmt::fmt) endif()