cpp-common: replace bstd::string_view with nonstd::string_view
[babeltrace.git] / src / Makefile.am
index cbc74e3e5b0665d268d5f37f065daf89127e83a4..98d281a637003a42698bd767b9bbd5ed2301c169 100644 (file)
@@ -1,9 +1,9 @@
+# SPDX-FileCopyrightText: 2019-2023 EfficiOS, Inc.
 # SPDX-License-Identifier: MIT
 
-# Build 'common' first to ensure 'version.h' is generated before any
-# compilation.
+# Build the current dir containing the library and plugins before the cli and
+# bindings.
 SUBDIRS = \
-       common \
        . \
        cli
 
@@ -11,46 +11,38 @@ if ENABLE_PYTHON_BINDINGS
 SUBDIRS += bindings/python/bt2
 endif
 
-noinst_HEADERS = \
-       cpp-common/bt2/clock-class.hpp \
-       cpp-common/bt2/clock-snapshot.hpp \
-       cpp-common/bt2/common-iter.hpp \
-       cpp-common/bt2/exc.hpp \
-       cpp-common/bt2/field-class.hpp \
-       cpp-common/bt2/field.hpp \
-       cpp-common/bt2/field-path.hpp \
-       cpp-common/bt2/integer-range.hpp \
-       cpp-common/bt2/integer-range-set.hpp \
-       cpp-common/bt2/internal/borrowed-obj.hpp \
-       cpp-common/bt2/internal/shared-obj.hpp \
-       cpp-common/bt2/internal/utils.hpp \
-       cpp-common/bt2/logging.hpp \
-       cpp-common/bt2/message.hpp \
-       cpp-common/bt2/trace-ir.hpp \
-       cpp-common/bt2/type-traits.hpp \
-       cpp-common/bt2/value.hpp \
-       cpp-common/align.hpp \
-       cpp-common/cfg-error-reporting.hpp \
-       cpp-common/cfg-error-reporting-throw.hpp \
-       cpp-common/cfg-logging-error-reporting.hpp \
-       cpp-common/cfg-logging-error-reporting-throw.hpp \
-       cpp-common/cfg-logging.hpp \
-       cpp-common/endian.hpp \
-       cpp-common/exc.hpp \
-       cpp-common/glib-up.hpp \
-       cpp-common/libc-up.hpp \
-       cpp-common/lib-str.hpp \
-       cpp-common/log-cfg.hpp \
-       cpp-common/make-unique.hpp \
-       cpp-common/nlohmann/json.hpp \
-       cpp-common/optional.hpp \
-       cpp-common/read-fixed-len-int.hpp \
-       cpp-common/safe-ops.hpp \
-       cpp-common/std-int.hpp \
-       cpp-common/string_view.hpp \
-       cpp-common/uuid.hpp \
-       cpp-common/uuid-view.hpp \
-       cpp-common/vector.hpp
+## This target generates an include file that contains the git version
+## string of the current branch, it must be continuously updated when
+## we build in the git repo and shipped in dist tarballs to reflect the
+## status of the tree when it was generated. If the tree is clean and
+## the current commit is a tag starting with "v", consider this a
+## release version and set an empty git version.
+
+version_verbose = $(version_verbose_@AM_V@)
+version_verbose_ = $(version_verbose_@AM_DEFAULT_V@)
+version_verbose_0 = @echo "  GEN     " $@;
+
+common/version.i:
+       $(version_verbose)GREP=$(GREP) SED=$(SED) TOP_SRCDIR="$(top_srcdir)" $(SHELL) $(srcdir)/gen-version-i.sh
+
+dist_noinst_SCRIPTS = gen-version-i.sh
+
+# Ensure version.i is generated before any code is built.
+BUILT_SOURCES = common/version.i
+
+##
+## version.i is defined as a .PHONY target even if it's a real file,
+## we want the target to be re-run on every make.
+##
+.PHONY: common/version.i
+
+CLEANFILES = common/version.i.tmp
+
+##
+## Only clean "version.i" on dist-clean, we need to keep it on regular
+## clean when it's part of a dist tarball.
+##
+DISTCLEANFILES = common/version.i
 
 #
 # Convenience libraries
@@ -59,7 +51,10 @@ noinst_HEADERS = \
 noinst_LTLIBRARIES = \
        argpar/libargpar.la \
        autodisc/libautodisc.la \
+       common/libcommon.la \
        compat/libcompat.la \
+       cpp-common/libcpp-common.la \
+       cpp-common/vendor/fmt/libfmt.la \
        ctfser/libctfser.la \
        fd-cache/libfd-cache.la \
        logging/liblogging.la \
@@ -70,6 +65,7 @@ noinst_LTLIBRARIES = \
        plugins/ctf/common/metadata/libctf-parser.la \
        string-format/libstring-format.la
 
+
 argpar_libargpar_la_SOURCES = \
        argpar/argpar.c \
        argpar/argpar.h
@@ -78,6 +74,25 @@ autodisc_libautodisc_la_SOURCES = \
        autodisc/autodisc.c \
        autodisc/autodisc.h
 
+common_libcommon_la_SOURCES = \
+       common/align.h \
+       common/assert.c \
+       common/assert.h \
+       common/common.c \
+       common/common.h \
+       common/list.h \
+       common/macros.h \
+       common/mmap-align.h \
+       common/safe.h \
+       common/uuid.c \
+       common/uuid.h \
+       common/version.h \
+       common/version.i
+
+common_libcommon_la_CPPFLAGS = \
+       $(AM_CPPFLAGS) \
+       -DBABELTRACE_PLUGINS_DIR=\"$(BABELTRACE_PLUGINS_DIR)\"
+
 compat_libcompat_la_SOURCES = \
        compat/bitfield.h \
        compat/compiler.h \
@@ -96,6 +111,88 @@ compat_libcompat_la_SOURCES = \
        compat/unistd.h \
        compat/utc.h
 
+cpp_common_libcpp_common_la_SOURCES = \
+       cpp-common/bt2/borrowed-object-iterator.hpp \
+       cpp-common/bt2/borrowed-object-proxy.hpp \
+       cpp-common/bt2/borrowed-object.hpp \
+       cpp-common/bt2/clock-class.hpp \
+       cpp-common/bt2/clock-snapshot.hpp \
+       cpp-common/bt2/component-class-dev.hpp \
+       cpp-common/bt2/component-class.hpp \
+       cpp-common/bt2/component-port.hpp \
+       cpp-common/bt2/graph.hpp \
+       cpp-common/bt2/exc.hpp \
+       cpp-common/bt2/field-class.hpp \
+       cpp-common/bt2/field-path.hpp \
+       cpp-common/bt2/field.hpp \
+       cpp-common/bt2/integer-range-set.hpp \
+       cpp-common/bt2/integer-range.hpp \
+       cpp-common/bt2/internal/comp-cls-bridge.hpp \
+       cpp-common/bt2/internal/utils.hpp \
+       cpp-common/bt2/logging.hpp \
+       cpp-common/bt2/message-array.hpp \
+       cpp-common/bt2/message-iterator.hpp \
+       cpp-common/bt2/message.hpp \
+       cpp-common/bt2/optional-borrowed-object.hpp \
+       cpp-common/bt2/plugin-dev.hpp \
+       cpp-common/bt2/plugin-load.hpp \
+       cpp-common/bt2/plugin-set.hpp \
+       cpp-common/bt2/plugin.hpp \
+       cpp-common/bt2/private-query-executor.hpp \
+       cpp-common/bt2/query-executor.hpp \
+       cpp-common/bt2/raw-value-proxy.hpp \
+       cpp-common/bt2/self-component-class.hpp \
+       cpp-common/bt2/self-component-port.hpp \
+       cpp-common/bt2/self-message-iterator-configuration.hpp \
+       cpp-common/bt2/self-message-iterator.hpp \
+       cpp-common/bt2/shared-object.hpp \
+       cpp-common/bt2/trace-ir.hpp \
+       cpp-common/bt2/type-traits.hpp \
+       cpp-common/bt2/value.hpp \
+       cpp-common/bt2/wrap.hpp \
+       cpp-common/bt2c/align.hpp \
+       cpp-common/bt2c/c-string-view.hpp \
+       cpp-common/bt2c/call.hpp \
+       cpp-common/bt2c/dummy.cpp \
+       cpp-common/bt2c/endian.hpp \
+       cpp-common/bt2c/exc.hpp \
+       cpp-common/bt2c/fmt.hpp \
+       cpp-common/bt2c/glib-up.hpp \
+       cpp-common/bt2c/libc-up.hpp \
+       cpp-common/bt2c/logging.hpp \
+       cpp-common/bt2c/prio-heap.hpp \
+       cpp-common/bt2c/read-fixed-len-int.hpp \
+       cpp-common/bt2c/safe-ops.hpp \
+       cpp-common/bt2c/std-int.hpp \
+       cpp-common/bt2c/type-traits.hpp \
+       cpp-common/bt2c/uuid.hpp \
+       cpp-common/bt2c/vector.hpp \
+       cpp-common/bt2s/make-unique.hpp \
+       cpp-common/bt2s/optional.hpp \
+       cpp-common/bt2s/span.hpp \
+       cpp-common/bt2s/string-view.hpp \
+       cpp-common/vendor/nlohmann/json.hpp \
+       cpp-common/vendor/optional-lite/optional.hpp \
+       cpp-common/vendor/span-lite/span.hpp \
+       cpp-common/vendor/string-view-lite/string_view.hpp
+
+cpp_common_vendor_fmt_libfmt_la_SOURCES = \
+       cpp-common/vendor/fmt/args.h \
+       cpp-common/vendor/fmt/chrono.h \
+       cpp-common/vendor/fmt/color.h \
+       cpp-common/vendor/fmt/compile.h \
+       cpp-common/vendor/fmt/core.h \
+       cpp-common/vendor/fmt/format-inl.h \
+       cpp-common/vendor/fmt/format.cc \
+       cpp-common/vendor/fmt/format.h \
+       cpp-common/vendor/fmt/os.cc \
+       cpp-common/vendor/fmt/os.h \
+       cpp-common/vendor/fmt/ostream.h \
+       cpp-common/vendor/fmt/printf.h \
+       cpp-common/vendor/fmt/ranges.h \
+       cpp-common/vendor/fmt/std.h \
+       cpp-common/vendor/fmt/xchar.h
+
 ctfser_libctfser_la_SOURCES = \
        ctfser/ctfser.c \
        ctfser/ctfser.h
@@ -106,7 +203,8 @@ fd_cache_libfd_cache_la_SOURCES = \
 
 logging_liblogging_la_SOURCES = \
        logging/comp-logging.h \
-       logging/log.c \
+       logging/log-api.c \
+       logging/log-api.h \
        logging/log.h
 
 param_parse_libparam_parse_la_SOURCES = \
@@ -190,11 +288,9 @@ if BABELTRACE_BUILD_WITH_MINGW
 plugins_ctf_common_metadata_libctf_ast_la_LIBADD = -lintl -liconv -lole32
 endif
 
-BUILT_SOURCES = \
+BUILT_SOURCES += \
        plugins/ctf/common/metadata/parser.hpp
 
-# Start with empty files to clean
-CLEANFILES =
 ALL_LOCAL =
 
 if HAVE_BISON
@@ -289,7 +385,6 @@ lib_libbabeltrace2_la_SOURCES = \
        lib/graph/message/event.h \
        lib/graph/message-iterator-class.c \
        lib/graph/message-iterator-class.h \
-       lib/graph/message/iterator.h \
        lib/graph/message/message.c \
        lib/graph/message/message.h \
        lib/graph/message/message-iterator-inactivity.c \
@@ -319,6 +414,7 @@ lib_libbabeltrace2_la_SOURCES = \
        lib/graph/interrupter.c \
        lib/graph/interrupter.h \
        lib/graph/iterator.c \
+       lib/graph/iterator.h \
        lib/graph/mip.c \
        lib/graph/port.c \
        lib/graph/port.h \
@@ -328,8 +424,6 @@ lib_libbabeltrace2_la_SOURCES = \
        lib/plugin/plugin.h \
        lib/plugin/plugin-so.c \
        lib/plugin/plugin-so.h \
-       lib/prio-heap/prio-heap.c \
-       lib/prio-heap/prio-heap.h \
        lib/trace-ir/attributes.c \
        lib/trace-ir/attributes.h \
        lib/trace-ir/clock-class.c \
@@ -394,7 +488,7 @@ lib_libbabeltrace2_la_CPPFLAGS = \
 
 lib_libbabeltrace2_la_LIBADD = \
        logging/liblogging.la \
-       common/libbabeltrace2-common.la \
+       common/libcommon.la \
        compat/libcompat.la
 
 ctf_writer_libbabeltrace2_ctf_writer_la_SOURCES = \
@@ -451,7 +545,7 @@ ctf_writer_libbabeltrace2_ctf_writer_la_LDFLAGS = \
 
 ctf_writer_libbabeltrace2_ctf_writer_la_LIBADD = \
        logging/liblogging.la \
-       common/libbabeltrace2-common.la \
+       common/libcommon.la \
        ctfser/libctfser.la \
        compat/libcompat.la
 
@@ -489,7 +583,7 @@ python_plugin_provider_babeltrace2_python_plugin_provider_la_LIBADD =
 if !ENABLE_BUILT_IN_PLUGINS
 python_plugin_provider_babeltrace2_python_plugin_provider_la_LIBADD += \
        logging/liblogging.la \
-       common/libbabeltrace2-common.la \
+       common/libcommon.la \
        py-common/libpy-common.la \
        lib/libbabeltrace2.la
 endif
@@ -512,11 +606,15 @@ plugins_utils_babeltrace_plugin_utils_la_SOURCES = \
        plugins/utils/counter/counter.h \
        plugins/utils/dummy/dummy.c \
        plugins/utils/dummy/dummy.h \
-       plugins/utils/muxer/muxer.c \
-       plugins/utils/muxer/muxer.h \
+       plugins/utils/muxer/comp.cpp \
+       plugins/utils/muxer/comp.hpp \
+       plugins/utils/muxer/msg-iter.cpp \
+       plugins/utils/muxer/msg-iter.hpp \
+       plugins/utils/muxer/upstream-msg-iter.cpp \
+       plugins/utils/muxer/upstream-msg-iter.hpp \
        plugins/utils/trimmer/trimmer.c \
        plugins/utils/trimmer/trimmer.h \
-       plugins/utils/plugin.c
+       plugins/utils/plugin.cpp
 
 plugins_utils_babeltrace_plugin_utils_la_LDFLAGS = \
        $(AM_LDFLAGS) \
@@ -529,7 +627,8 @@ plugins_utils_babeltrace_plugin_utils_la_LIBADD = \
 if !ENABLE_BUILT_IN_PLUGINS
 plugins_utils_babeltrace_plugin_utils_la_LIBADD += \
        lib/libbabeltrace2.la \
-       common/libbabeltrace2-common.la \
+       common/libcommon.la \
+       cpp-common/vendor/fmt/libfmt.la \
        logging/liblogging.la \
        plugins/common/param-validation/libparam-validation.la
 endif
@@ -593,7 +692,7 @@ plugins_ctf_babeltrace_plugin_ctf_la_LIBADD += \
        lib/libbabeltrace2.la \
        logging/liblogging.la \
        plugins/common/muxing/libmuxing.la \
-       common/libbabeltrace2-common.la \
+       common/libcommon.la \
        ctfser/libctfser.la
 endif
 
@@ -623,7 +722,7 @@ plugins_text_babeltrace_plugin_text_la_LIBADD =
 if !ENABLE_BUILT_IN_PLUGINS
 plugins_text_babeltrace_plugin_text_la_LIBADD += \
        lib/libbabeltrace2.la \
-       common/libbabeltrace2-common.la \
+       common/libcommon.la \
        logging/liblogging.la \
        compat/libcompat.la \
        plugins/common/param-validation/libparam-validation.la
@@ -649,8 +748,13 @@ plugins_lttng_utils_babeltrace_plugin_lttng_utils_la_LIBADD = \
 if !ENABLE_BUILT_IN_PLUGINS
 plugins_lttng_utils_babeltrace_plugin_lttng_utils_la_LIBADD += \
        lib/libbabeltrace2.la \
-       common/libbabeltrace2-common.la \
+       common/libcommon.la \
        logging/liblogging.la \
        plugins/common/param-validation/libparam-validation.la
 endif # !ENABLE_BUILT_IN_PLUGINS
 endif # ENABLE_DEBUG_INFO
+
+EXTRA_DIST = \
+       cpp-common/vendor/optional-lite/optional.hpp.license \
+       cpp-common/vendor/span-lite/span.hpp.license \
+       cpp-common/vendor/string-view-lite/string_view.hpp.license
This page took 0.027401 seconds and 4 git commands to generate.