Skip to content

Commit

Permalink
Add frozen library support - for compile-time dict, set support
Browse files Browse the repository at this point in the history
Change-Id: I8fa02569ba02048cc3ef02b349aafba1c0cbebb4
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/153173
Reviewed-by: Taichi Haradaguchi <20001722@ymail.ne.jp>
Tested-by: Jenkins
Reviewed-by: Tomaž Vajngerl <quikee@gmail.com>
  • Loading branch information
quikee committed Jun 17, 2023
1 parent 447a4bc commit 472fec1
Show file tree
Hide file tree
Showing 8 changed files with 69 additions and 0 deletions.
1 change: 1 addition & 0 deletions Makefile.fetch
Original file line number Diff line number Diff line change
Expand Up @@ -125,6 +125,7 @@ $(WORKDIR)/download: $(BUILDDIR)/config_$(gb_Side).mk $(SRCDIR)/download.lst $(S
$(call fetch_Optional,FONTCONFIG,FONTCONFIG_TARBALL) \
$(call fetch_Optional,FREEHAND,FREEHAND_TARBALL) \
$(call fetch_Optional,FREETYPE,FREETYPE_TARBALL) \
FROZEN_TARBALL \
$(call fetch_Optional,EPOXY,EPOXY_TARBALL) \
$(call fetch_Optional,GLM,GLM_TARBALL) \
$(call fetch_Optional,GPGMEPP,GPGME_TARBALL) \
Expand Down
10 changes: 10 additions & 0 deletions RepositoryExternal.mk
Original file line number Diff line number Diff line change
Expand Up @@ -4297,4 +4297,14 @@ endif # ENABLE_ZXING

endif # SYSTEM_ZXING


define gb_LinkTarget__use_frozen
$(call gb_LinkTarget_use_unpacked,$(1),frozen)
$(call gb_LinkTarget_set_include,$(1),\
-I$(call gb_UnpackedTarball_get_dir,frozen/include/)\
$$(INCLUDE) \
)
endef


# vim: set noet sw=4 ts=4:
5 changes: 5 additions & 0 deletions download.lst
Original file line number Diff line number Diff line change
Expand Up @@ -202,6 +202,11 @@ FREETYPE_TARBALL := freetype-2.13.0.tar.xz
# three static lines
# so that git cherry-pick
# will not run into conflicts
FROZEN_SHA256SUM := f7c7075750e8fceeac081e9ef01944f221b36d9725beac8681cbd2838d26be45
FROZEN_TARBALL := frozen-1.1.1.tar.gz
# three static lines
# so that git cherry-pick
# will not run into conflicts
GLM_SHA256SUM := 6bba5f032bed47c73ad9397f2313b9acbfb56253d0d0576b5873d3dcb25e99ad
GLM_TARBALL := glm-0.9.9.8.zip
# three static lines
Expand Down
1 change: 1 addition & 0 deletions external/Module_external.mk
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@ $(eval $(call gb_Module_add_moduledirs,external,\
$(call gb_Helper_optional,FONTCONFIG,fontconfig) \
$(call gb_Helper_optional,FREEHAND,libfreehand) \
$(call gb_Helper_optional,FREETYPE,freetype) \
frozen \
$(call gb_Helper_optional,GLM,glm) \
$(call gb_Helper_optional,GPGMEPP,gpgmepp) \
$(call gb_Helper_optional,GRAPHITE,graphite) \
Expand Down
16 changes: 16 additions & 0 deletions external/frozen/Module_frozen.mk
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
# -*- Mode: makefile-gmake; tab-width: 4; indent-tabs-mode: t; fill-column: 100 -*-
#
# This file is part of the LibreOffice project.
#
# This Source Code Form is subject to the terms of the Mozilla Public
# License, v. 2.0. If a copy of the MPL was not distributed with this
# file, You can obtain one at http://mozilla.org/MPL/2.0/.
#

$(eval $(call gb_Module_Module,frozen))

$(eval $(call gb_Module_add_targets,frozen,\
UnpackedTarball_frozen \
))

# vim: set noet sw=4 ts=4:
7 changes: 7 additions & 0 deletions external/frozen/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
External header only library frozen

Header-only library that provides 0 cost initialization for immutable containers, fixed-size containers, and various algorithms.

https://github.com/serge-sans-paille/frozen

Release archives at: https://github.com/serge-sans-paille/frozen/tags
18 changes: 18 additions & 0 deletions external/frozen/UnpackedTarball_frozen.mk
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
# -*- Mode: makefile-gmake; tab-width: 4; indent-tabs-mode: t; fill-column: 100 -*-
#
# This file is part of the LibreOffice project.
#
# This Source Code Form is subject to the terms of the Mozilla Public
# License, v. 2.0. If a copy of the MPL was not distributed with this
# file, You can obtain one at http://mozilla.org/MPL/2.0/.
#

$(eval $(call gb_UnpackedTarball_UnpackedTarball,frozen))

$(eval $(call gb_UnpackedTarball_set_tarball,frozen,$(FROZEN_TARBALL)))

$(eval $(call gb_UnpackedTarball_add_patches,frozen,\
external/frozen/defines_h_constexpr_string.patch.0 \
))

# vim: set noet sw=4 ts=4:
11 changes: 11 additions & 0 deletions external/frozen/defines_h_constexpr_string.patch.0
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
--- include/frozen/bits/defines.h
+++ include/frozen/bits/defines.h
@@ -59,7 +59,7 @@
#define FROZEN_LETITGO_HAS_DEDUCTION_GUIDES
#endif

-#if __cpp_lib_constexpr_string >= 201907L
+#if defined(__cpp_lib_constexpr_string) && __cpp_lib_constexpr_string >= 201907L
#define FROZEN_LETITGO_HAS_CONSTEXPR_STRING
#endif

0 comments on commit 472fec1

Please sign in to comment.