From 12a5f73418fafb801858ad71d6ec04d857372784 Mon Sep 17 00:00:00 2001 From: Scott Mansell Date: Wed, 10 Aug 2022 18:21:47 +1200 Subject: [PATCH] Workaround Freebsd/clang/fmt bug --- CMakeLists.txt | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/CMakeLists.txt b/CMakeLists.txt index a4f4019217..163ea2c943 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -440,6 +440,12 @@ if(CMAKE_SYSTEM_NAME MATCHES "FreeBSD|NetBSD") set(CMAKE_PREFIX_PATH "${CMAKE_PREFIX_PATH};/usr/local") set(CMAKE_REQUIRED_INCLUDES "/usr/local/include") set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -L/usr/local/lib") + + if (CMAKE_CXX_COMPILER_ID MATCHES "Clang" AND CMAKE_CXX_COMPILER_VERSION VERSION_LESS 14.0) + # Workaround: the llvm libc++ and versions of clang eariler than 14 have a bug with consteval + # so we define FMT_CONSTEVAL to blank to just disable consteval in fmt + add_definitions(-DFMT_CONSTEVAL=) + endif() endif() # Dolphin requires threads.