Code Monkey home page Code Monkey logo

Comments (9)

wengxt avatar wengxt commented on August 29, 2024

You need https://github.com/fmtlib/fmt

from fcitx5.

wengxt avatar wengxt commented on August 29, 2024

Probably you need a specific flag to compile fmt or it is not up to date.

from fcitx5.

hosiet avatar hosiet commented on August 29, 2024

I found Debian's libfmt heavily patched. Among the patches exists the following one:

From: "Eugene V. Lyubimkin" <[email protected]>
Date: Sat, 24 Sep 2016 16:14:24 +0200
Subject: fmt: cmakelists: remove header-only targets

For Debian, client code shouldn't try to compile .cc-files by itself but
instead use a static library compiled by this package.

This also really separate sources with headers. Otherwise the install
target will install also .cc-files to /usr/include.
---
 fmt/CMakeLists.txt | 21 ++-------------------
 1 file changed, 2 insertions(+), 19 deletions(-)

diff --git a/fmt/CMakeLists.txt b/fmt/CMakeLists.txt
index 90eaf57..e5d151a 100644
--- a/fmt/CMakeLists.txt
+++ b/fmt/CMakeLists.txt
@@ -1,7 +1,6 @@
 # Define the fmt library, its includes and the needed defines.
-# *.cc are added to FMT_HEADERS for the header-only configuration.
-set(FMT_HEADERS container.h format.h format.cc ostream.h ostream.cc printf.h
-                printf.cc string.h time.h)
+set(FMT_HEADERS container.h format.h ostream.h printf.h string.h time.h)
+set(FMT_SOURCES format.cc ostream.cc printf.cc)
 if (HAVE_OPEN)
   set(FMT_HEADERS ${FMT_HEADERS} posix.h)
   set(FMT_SOURCES ${FMT_SOURCES} posix.cc)
@@ -34,19 +33,6 @@ if (BUILD_SHARED_LIBS)
   target_compile_definitions(fmt PRIVATE FMT_EXPORT INTERFACE FMT_SHARED)
 endif ()
 
-#------------------------------------------------------------------------------
-# additionally define a header only library when cmake is new enough
-if (CMAKE_VERSION VERSION_GREATER 3.1.0 OR CMAKE_VERSION VERSION_EQUAL 3.1.0)
-  add_library(fmt-header-only INTERFACE)
-  add_library(fmt::fmt-header-only ALIAS fmt-header-only)
-
-  target_compile_definitions(fmt-header-only INTERFACE FMT_HEADER_ONLY=1)
-
-  target_include_directories(fmt-header-only INTERFACE
-    $<BUILD_INTERFACE:${PROJECT_SOURCE_DIR}>
-    $<INSTALL_INTERFACE:include>)
-endif ()
-
 # Install targets.
 if (FMT_INSTALL)
   include(CMakePackageConfigHelpers)
@@ -57,9 +43,6 @@ if (FMT_INSTALL)
   set(targets_export_name fmt-targets)
 
   set (INSTALL_TARGETS fmt)
-  if (TARGET fmt-header-only)
-    set(INSTALL_TARGETS ${INSTALL_TARGETS} fmt-header-only)
-  endif ()
 
   set(FMT_LIB_DIR lib CACHE STRING
     "Installation directory for libraries, relative to ${CMAKE_INSTALL_PREFIX}.")

(You may retrieve Debian's source code here.)

@wengxt Any comments?

It's a blocker for fcitx5 into Debian, let's keep this issue open.

from fcitx5.

wengxt avatar wengxt commented on August 29, 2024

from fcitx5.

wengxt avatar wengxt commented on August 29, 2024

You should file a bug to remove the patch, or to compile the package
cmake -DCMAKE_POSITION_INDEPENDENT_CODE=TRUE

I prefer removing the patch.

from fcitx5.

wengxt avatar wengxt commented on August 29, 2024

or -DBUILD_SHARED_LIBS=On . Anyway, otherwise the fmt in debian is not usable for fcitx5.

from fcitx5.

hosiet avatar hosiet commented on August 29, 2024

https://bugs.debian.org/878070

from fcitx5.

hosiet avatar hosiet commented on August 29, 2024

https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=878070;msg=10

@wengxt We should start working on using static library as an alternative on Debian-based systems.

from fcitx5.

hosiet avatar hosiet commented on August 29, 2024

I think this problem is solved by the latest commit. Closing.

from fcitx5.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.