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] 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 782f274baf..a8706b0deb 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 91210752db..21aaaf7f36 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()