summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--.github/workflows/c-cpp.yml2
-rw-r--r--kms++/inc/kms++/format.h28
-rw-r--r--kms++/meson.build2
-rw-r--r--kms++/src/videomode.cpp2
-rw-r--r--kms++util/meson.build2
-rw-r--r--kms++util/src/testpat.cpp1
-rw-r--r--kmscube/meson.build2
-rw-r--r--meson.build2
-rw-r--r--utils/kmsprint.cpp2
-rw-r--r--utils/kmstest.cpp2
-rw-r--r--utils/meson.build2
11 files changed, 36 insertions, 11 deletions
diff --git a/.github/workflows/c-cpp.yml b/.github/workflows/c-cpp.yml
index eccafb2..c900386 100644
--- a/.github/workflows/c-cpp.yml
+++ b/.github/workflows/c-cpp.yml
@@ -52,7 +52,7 @@ jobs:
- name: install deps
run: |
sudo apt install -y libdrm-dev libegl1-mesa-dev libgles2-mesa-dev libwayland-dev \
- libx11-xcb-dev libx11-dev libgbm-dev libevdev-dev libfmt-dev
+ libx11-xcb-dev libx11-dev libgbm-dev libevdev-dev
- name: configure
env:
diff --git a/kms++/inc/kms++/format.h b/kms++/inc/kms++/format.h
new file mode 100644
index 0000000..b48babe
--- /dev/null
+++ b/kms++/inc/kms++/format.h
@@ -0,0 +1,28 @@
+#pragma once
+
+#include <cstdio>
+#include <format>
+#include <string>
+
+// This can be removed when moving to C++23. For now, this gives us
+// fmt::format() and fmt::print().
+
+namespace fmt {
+
+using std::format;
+
+template<typename... Args>
+void print(std::format_string<Args...> fmtstr, Args&&... args)
+{
+ std::string s = std::format(fmtstr, std::forward<Args>(args)...);
+ std::fwrite(s.data(), 1, s.size(), stdout);
+}
+
+template<typename... Args>
+void print(std::FILE* f, std::format_string<Args...> fmtstr, Args&&... args)
+{
+ std::string s = std::format(fmtstr, std::forward<Args>(args)...);
+ std::fwrite(s.data(), 1, s.size(), f);
+}
+
+} // namespace fmt
diff --git a/kms++/meson.build b/kms++/meson.build
index cd7a494..4fb5fc9 100644
--- a/kms++/meson.build
+++ b/kms++/meson.build
@@ -68,7 +68,7 @@ else
omapdrm_enabled = false
endif
-libkmsxx_deps = [ libdrm_dep, libfmt_dep, libdrmomap_dep ]
+libkmsxx_deps = [ libdrm_dep, libdrmomap_dep ]
libkmsxx = library('kms++',
libkmsxx_sources,
diff --git a/kms++/src/videomode.cpp b/kms++/src/videomode.cpp
index 4be6de7..b7b1b28 100644
--- a/kms++/src/videomode.cpp
+++ b/kms++/src/videomode.cpp
@@ -2,7 +2,7 @@
#include <xf86drmMode.h>
#include <cmath>
#include <sstream>
-#include <fmt/format.h>
+#include <kms++/format.h>
#include <kms++/kms++.h>
#include "helpers.h"
diff --git a/kms++util/meson.build b/kms++util/meson.build
index ea998f0..e2beed6 100644
--- a/kms++util/meson.build
+++ b/kms++util/meson.build
@@ -40,7 +40,7 @@ if thread_dep.found()
libkmsxxutil_args += [ '-DHAS_PTHREAD' ]
endif
-libkmsxxutil_deps = [ libkmsxx_dep, libfmt_dep, thread_dep ]
+libkmsxxutil_deps = [ libkmsxx_dep, thread_dep ]
libkmsxxutil = library('kms++util',
libkmsxxutil_sources,
diff --git a/kms++util/src/testpat.cpp b/kms++util/src/testpat.cpp
index fe0988e..e424103 100644
--- a/kms++util/src/testpat.cpp
+++ b/kms++util/src/testpat.cpp
@@ -1,6 +1,5 @@
#include <cstring>
-#include <fmt/format.h>
#include <functional>
#include <optional>
#include <span>
diff --git a/kmscube/meson.build b/kmscube/meson.build
index fd0fb96..c26badc 100644
--- a/kmscube/meson.build
+++ b/kmscube/meson.build
@@ -21,7 +21,7 @@ kmscube_sources = files([
])
kmscube_deps = [
- libdrm_dep, libkmsxx_dep, libkmsxxutil_dep, libfmt_dep,
+ libdrm_dep, libkmsxx_dep, libkmsxxutil_dep,
dependency('x11'),
dependency('xcb'),
dependency('x11-xcb'),
diff --git a/meson.build b/meson.build
index be0b2a1..0a67bdf 100644
--- a/meson.build
+++ b/meson.build
@@ -36,8 +36,6 @@ endif
add_project_arguments(cpp_arguments, language : 'cpp')
-libfmt_dep = dependency('fmt')
-
libdrmomap_dep = dependency('libdrm_omap', required : get_option('omap'))
if libdrmomap_dep.found()
diff --git a/utils/kmsprint.cpp b/utils/kmsprint.cpp
index d8b4219..849c05c 100644
--- a/utils/kmsprint.cpp
+++ b/utils/kmsprint.cpp
@@ -4,7 +4,7 @@
#include <iostream>
#include <string>
#include <unistd.h>
-#include <fmt/format.h>
+#include <kms++/format.h>
#include <kms++/kms++.h>
#include <kms++util/kms++util.h>
diff --git a/utils/kmstest.cpp b/utils/kmstest.cpp
index 76b64ca..40143c3 100644
--- a/utils/kmstest.cpp
+++ b/utils/kmstest.cpp
@@ -9,7 +9,7 @@
#include <sys/select.h>
-#include <fmt/format.h>
+#include <kms++/format.h>
#include <kms++/kms++.h>
#include <kms++/modedb.h>
diff --git a/utils/meson.build b/utils/meson.build
index b1d3082..54021d3 100644
--- a/utils/meson.build
+++ b/utils/meson.build
@@ -10,7 +10,7 @@ endif
utils_enabled = true
-common_deps = [ libkmsxx_dep, libkmsxxutil_dep, libfmt_dep ]
+common_deps = [ libkmsxx_dep, libkmsxxutil_dep ]
libevdev_dep = dependency('libevdev', required : false)