Upgrade fmt dependency to v10.2.1 (#6869)

* Put fmt into version agnostic subdir

* Add fmt to dependency update script

* Remove manually added fmt

* Squashed 'third_party/fmt/' content from commit e69e5f977

git-subtree-dir: third_party/fmt
git-subtree-split: e69e5f977d458f2650bb346dadf2ad30c5320281
This commit is contained in:
Dennis Luxen
2024-05-07 20:55:55 +02:00
committed by GitHub
parent 82aa369db3
commit 79de092bb2
259 changed files with 14941 additions and 38486 deletions
+30
View File
@@ -0,0 +1,30 @@
cmake_minimum_required(VERSION 3.8...3.25)
project(fmt-link CXX)
set(BUILD_SHARED_LIBS OFF)
set(CMAKE_VISIBILITY_INLINES_HIDDEN TRUE)
set(CMAKE_CXX_VISIBILITY_PRESET "hidden")
# Broken LTO on GCC 4
if (CMAKE_COMPILER_IS_GNUCXX AND CMAKE_CXX_COMPILER_VERSION VERSION_LESS 5)
set(BROKEN_LTO ON)
endif ()
if (NOT BROKEN_LTO AND CMAKE_VERSION VERSION_GREATER "3.8")
# CMake 3.9+
include(CheckIPOSupported)
check_ipo_supported(RESULT HAVE_IPO)
if (HAVE_IPO)
set(CMAKE_INTERPROCEDURAL_OPTIMIZATION TRUE)
endif ()
endif ()
add_subdirectory(../.. fmt)
set_property(TARGET fmt PROPERTY POSITION_INDEPENDENT_CODE ON)
add_library(library-test SHARED library.cc)
target_link_libraries(library-test PRIVATE fmt::fmt)
add_executable(exe-test main.cc)
target_link_libraries(exe-test PRIVATE library-test)
+5
View File
@@ -0,0 +1,5 @@
#include <fmt/compile.h>
__attribute__((visibility("default"))) std::string foo() {
return fmt::format(FMT_COMPILE("foo bar {}"), 4242);
}
+6
View File
@@ -0,0 +1,6 @@
#include <iostream>
#include <string>
extern std::string foo();
int main() { std::cout << foo() << std::endl; }