blob: 7319280ca45bf4f6e59f6bd446f0e28567ff2f67 [file] [log] [blame]
Brad Bishop996bc452019-12-02 13:05:15 -05001From 87df05c3f83c563af76ab00567e7a1ab7a6ebc88 Mon Sep 17 00:00:00 2001
2From: Peter Rosin <peda@axentia.se>
3Date: Sat, 9 Nov 2019 15:42:03 +0100
4Subject: [PATCH] dbus: avoid 'strange' chars from the build dir in #defines
5
6gdbus-codegen uses include guards with the full path dir, and if there
7are "bad" characters, such as '+', this fails miserably. E.g. Yocto has a
8tendency to build in directories named from the Yocto package version and
9that package version containing a '+' are not uncommon, and even the
10standard in certain scenarios such as when using ${SRCPV}.
11
12Avoid the problem of the full path "leaking" into the source by avoiding
13the normal include guards and request "#pragma once" instead.
14
15Signed-off-by: Peter Rosin <peda@axentia.se>
16---
Patrick Williams520786c2023-06-25 16:20:36 -050017Upstream-Status: Pending
18
Brad Bishop996bc452019-12-02 13:05:15 -050019 dbus/CMakeLists.txt | 12 ++++++------
20 1 file changed, 6 insertions(+), 6 deletions(-)
21
22diff --git a/dbus/CMakeLists.txt b/dbus/CMakeLists.txt
23index f5096ce10ecd..013c32239e12 100644
24--- a/dbus/CMakeLists.txt
25+++ b/dbus/CMakeLists.txt
26@@ -43,37 +43,37 @@ else()
27 endif()
28
29 add_custom_command(OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/org-bluez-adaptater1.c
30- COMMAND gdbus-codegen --interface-prefix org.bluez.Adapter1. --generate-c-code ${CMAKE_CURRENT_BINARY_DIR}/org-bluez-adaptater1 ${CMAKE_CURRENT_SOURCE_DIR}/${DBUS_BLUEZ_API}/org.bluez.Adapter1.xml
31+ COMMAND gdbus-codegen --pragma-once --interface-prefix org.bluez.Adapter1. --generate-c-code ${CMAKE_CURRENT_BINARY_DIR}/org-bluez-adaptater1 ${CMAKE_CURRENT_SOURCE_DIR}/${DBUS_BLUEZ_API}/org.bluez.Adapter1.xml
32 DEPENDS ${CMAKE_CURRENT_SOURCE_DIR}/${DBUS_BLUEZ_API}/org.bluez.Adapter1.xml
33 COMMENT "Generate D-Bus 'org.bluez.Adapter1.xml'"
34 )
35
36 add_custom_command(OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/org-bluez-device1.c
37- COMMAND gdbus-codegen --interface-prefix org.bluez.Device1. --generate-c-code ${CMAKE_CURRENT_BINARY_DIR}/org-bluez-device1 ${CMAKE_CURRENT_SOURCE_DIR}/${DBUS_BLUEZ_API}/org.bluez.Device1.xml
38+ COMMAND gdbus-codegen --pragma-once --interface-prefix org.bluez.Device1. --generate-c-code ${CMAKE_CURRENT_BINARY_DIR}/org-bluez-device1 ${CMAKE_CURRENT_SOURCE_DIR}/${DBUS_BLUEZ_API}/org.bluez.Device1.xml
39 DEPENDS ${CMAKE_CURRENT_SOURCE_DIR}/${DBUS_BLUEZ_API}/org.bluez.Device1.xml
40 COMMENT "Generate D-Bus 'org.bluez.Device1.xml'"
41 )
42
43 add_custom_command(OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/org-bluez-gattservice1.c
44- COMMAND gdbus-codegen --interface-prefix org.bluez.GattService1. --generate-c-code ${CMAKE_CURRENT_BINARY_DIR}/org-bluez-gattservice1 ${CMAKE_CURRENT_SOURCE_DIR}/${DBUS_BLUEZ_API}/org.bluez.GattService1.xml
45+ COMMAND gdbus-codegen --pragma-once --interface-prefix org.bluez.GattService1. --generate-c-code ${CMAKE_CURRENT_BINARY_DIR}/org-bluez-gattservice1 ${CMAKE_CURRENT_SOURCE_DIR}/${DBUS_BLUEZ_API}/org.bluez.GattService1.xml
46 DEPENDS ${CMAKE_CURRENT_SOURCE_DIR}/${DBUS_BLUEZ_API}/org.bluez.GattService1.xml
47 COMMENT "Generate D-Bus 'org.bluez.GattService1.xml'"
48 )
49
50 add_custom_command(OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/org-bluez-gattcharacteristic1.c
51- COMMAND gdbus-codegen --interface-prefix org.bluez.Characteristic1. --generate-c-code ${CMAKE_CURRENT_BINARY_DIR}/org-bluez-gattcharacteristic1 ${CMAKE_CURRENT_SOURCE_DIR}/${DBUS_BLUEZ_API}/org.bluez.GattCharacteristic1.xml
52+ COMMAND gdbus-codegen --pragma-once --interface-prefix org.bluez.Characteristic1. --generate-c-code ${CMAKE_CURRENT_BINARY_DIR}/org-bluez-gattcharacteristic1 ${CMAKE_CURRENT_SOURCE_DIR}/${DBUS_BLUEZ_API}/org.bluez.GattCharacteristic1.xml
53 DEPENDS ${CMAKE_CURRENT_SOURCE_DIR}/${DBUS_BLUEZ_API}/org.bluez.GattCharacteristic1.xml
54 COMMENT "Generate D-Bus 'org.bluez.GattCharacteristic1.xml'"
55 )
56
57 add_custom_command(OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/org-bluez-gattdescriptor1.c
58- COMMAND gdbus-codegen --interface-prefix org.bluez.Descriptor1. --generate-c-code ${CMAKE_CURRENT_BINARY_DIR}/org-bluez-gattdescriptor1 ${CMAKE_CURRENT_SOURCE_DIR}/${DBUS_BLUEZ_API}/org.bluez.GattDescriptor1.xml
59+ COMMAND gdbus-codegen --pragma-once --interface-prefix org.bluez.Descriptor1. --generate-c-code ${CMAKE_CURRENT_BINARY_DIR}/org-bluez-gattdescriptor1 ${CMAKE_CURRENT_SOURCE_DIR}/${DBUS_BLUEZ_API}/org.bluez.GattDescriptor1.xml
60 DEPENDS ${CMAKE_CURRENT_SOURCE_DIR}/${DBUS_BLUEZ_API}/org.bluez.GattDescriptor1.xml
61 COMMENT "Generate D-Bus 'org.bluez.GattDescriptor1.xml'"
62 )
63
64 add_custom_command(OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/org-bluez-battery1.c
65- COMMAND gdbus-codegen --interface-prefix org.bluez.Battery1. --generate-c-code ${CMAKE_CURRENT_BINARY_DIR}/org-bluez-battery1 ${CMAKE_CURRENT_SOURCE_DIR}/${DBUS_BLUEZ_API}/org.bluez.Battery1.xml
66+ COMMAND gdbus-codegen --pragma-once --interface-prefix org.bluez.Battery1. --generate-c-code ${CMAKE_CURRENT_BINARY_DIR}/org-bluez-battery1 ${CMAKE_CURRENT_SOURCE_DIR}/${DBUS_BLUEZ_API}/org.bluez.Battery1.xml
67 DEPENDS ${CMAKE_CURRENT_SOURCE_DIR}/${DBUS_BLUEZ_API}/org.bluez.Battery1.xml
68 COMMENT "Generate D-Bus 'org.bluez.Battery1.xml'"
69 )
70--
712.11.0
72