diff mbox series

[1/9] util: Introduce host-specific cpuinfo.h

Message ID 20230518044058.2777467-2-richard.henderson@linaro.org
State New
Headers show
Series Host-specific includes, begin cpuinfo.h | expand

Commit Message

Richard Henderson May 18, 2023, 4:40 a.m. UTC
The entire contents of the header is host-specific, but the
existence of such a header is not, which could prevent some
host specific ifdefs at the top of the file for the include.

Add include/host/{arch,generic} to the project arguments.

Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
---
Cc: Paolo Bonzini <pbonzini@redhat.com> (maintainer:Meson)
Cc: "Marc-André Lureau" <marcandre.lureau@redhat.com> (reviewer:Meson)
Cc: "Daniel P. Berrangé" <berrange@redhat.com> (reviewer:Meson)
Cc: Thomas Huth <thuth@redhat.com> (reviewer:Meson)
Cc: "Philippe Mathieu-Daudé" <philmd@linaro.org> (reviewer:Meson)
---
 include/host/generic/cpuinfo.h | 4 ++++
 meson.build                    | 8 ++++++++
 2 files changed, 12 insertions(+)
 create mode 100644 include/host/generic/cpuinfo.h

Comments

Juan Quintela May 18, 2023, 9:30 a.m. UTC | #1
Richard Henderson <richard.henderson@linaro.org> wrote:
> The entire contents of the header is host-specific, but the
> existence of such a header is not, which could prevent some
> host specific ifdefs at the top of the file for the include.
>
> Add include/host/{arch,generic} to the project arguments.
>
> Signed-off-by: Richard Henderson <richard.henderson@linaro.org>

Reviewed-by: Juan Quintela <quintela@redhat.com>
diff mbox series

Patch

diff --git a/include/host/generic/cpuinfo.h b/include/host/generic/cpuinfo.h
new file mode 100644
index 0000000000..eca672064a
--- /dev/null
+++ b/include/host/generic/cpuinfo.h
@@ -0,0 +1,4 @@ 
+/*
+ * No host specific cpu indentification.
+ * SPDX-License-Identifier: GPL-2.0-or-later
+ */
diff --git a/meson.build b/meson.build
index 4dddccb890..0dd806e8a5 100644
--- a/meson.build
+++ b/meson.build
@@ -292,6 +292,14 @@  add_project_arguments('-iquote', '.',
                       '-iquote', meson.current_source_dir() / 'include',
                       language: all_languages)
 
+include_host = meson.current_source_dir() / 'include/host/'
+if fs.is_dir(include_host / host_arch)
+  add_project_arguments('-iquote', include_host / host_arch,
+                        language: all_languages)
+endif
+add_project_arguments('-iquote', include_host / 'generic',
+                      language: all_languages)
+
 sparse = find_program('cgcc', required: get_option('sparse'))
 if sparse.found()
   run_target('sparse',