From 0f1bcae534915eea78810d30785674dca937cb87 Mon Sep 17 00:00:00 2001 From: Martchus Date: Tue, 30 Jan 2024 22:35:47 +0100 Subject: [PATCH] Fix build with c++utilities change to add header for compile definitions * Add include directory for testhelper library manually as using the imported target was not possibly * Fix visibility when using libsyncthing in syncthingwidgets * Update changed global headers along the way --- cli/CMakeLists.txt | 1 + fileitemactionplugin/global.h | 1 + plasmoid/lib/global.h | 1 + syncthing/global.h | 1 + syncthingconnector/CMakeLists.txt | 1 + syncthingconnector/global.h | 1 + syncthingmodel/global.h | 1 + syncthingwidgets/CMakeLists.txt | 4 +++- syncthingwidgets/global.h | 1 + testhelper/global.h | 1 + 10 files changed, 12 insertions(+), 1 deletion(-) diff --git a/cli/CMakeLists.txt b/cli/CMakeLists.txt index 4c21efd..6820dd6 100644 --- a/cli/CMakeLists.txt +++ b/cli/CMakeLists.txt @@ -31,6 +31,7 @@ use_syncthingconnector() # find libraries used by tests find_package(syncthingtesthelper ${META_APP_VERSION} REQUIRED) list(APPEND TEST_LIBRARIES ${SYNCTHINGTESTHELPER_LIB}) +list(APPEND PRIVATE_INCLUDE_DIRS "${CMAKE_CURRENT_BINARY_DIR}/../testhelper/include") use_standard_filesystem(LIBRARIES_VARIABLE "TEST_LIBRARIES" PACKAGES_VARIABLE "TEST_PACKAGES" OPTIONAL) # include modules to apply configuration diff --git a/fileitemactionplugin/global.h b/fileitemactionplugin/global.h index 3ba0408..ef28f9e 100644 --- a/fileitemactionplugin/global.h +++ b/fileitemactionplugin/global.h @@ -4,6 +4,7 @@ #ifndef SYNCTHINGFILEITEMACTION_GLOBAL #define SYNCTHINGFILEITEMACTION_GLOBAL +#include "syncthingfileitemaction-devel-definitions.h" #include #ifdef SYNCTHINGFILEITEMACTION_STATIC diff --git a/plasmoid/lib/global.h b/plasmoid/lib/global.h index b24e1a9..1df844b 100644 --- a/plasmoid/lib/global.h +++ b/plasmoid/lib/global.h @@ -4,6 +4,7 @@ #ifndef SYNCTHINGPLASMOID_GLOBAL #define SYNCTHINGPLASMOID_GLOBAL +#include "syncthingplasmoid-devel-definitions.h" #include #ifdef SYNCTHINGPLASMOID_STATIC diff --git a/syncthing/global.h b/syncthing/global.h index 57366ed..1c2e2b1 100644 --- a/syncthing/global.h +++ b/syncthing/global.h @@ -4,6 +4,7 @@ #ifndef LIB_SYNCTHING_GLOBAL #define LIB_SYNCTHING_GLOBAL +#include "syncthing-devel-definitions.h" #include #ifdef LIB_SYNCTHING_STATIC diff --git a/syncthingconnector/CMakeLists.txt b/syncthingconnector/CMakeLists.txt index ff4150b..d74dcb1 100644 --- a/syncthingconnector/CMakeLists.txt +++ b/syncthingconnector/CMakeLists.txt @@ -142,6 +142,7 @@ include(LibraryTarget) # link tests against test helper (can't use find_package because testhelper target is not present at this point) list(APPEND TEST_LIBRARIES syncthingtesthelper) +list(APPEND PRIVATE_INCLUDE_DIRS "${CMAKE_CURRENT_BINARY_DIR}/../testhelper/include") include(TestTarget) # avoid running this test in parallel with other tests spawning a Syncthing test instance diff --git a/syncthingconnector/global.h b/syncthingconnector/global.h index ddd728b..55846be 100644 --- a/syncthingconnector/global.h +++ b/syncthingconnector/global.h @@ -4,6 +4,7 @@ #ifndef LIB_SYNCTHING_CONNECTOR_GLOBAL #define LIB_SYNCTHING_CONNECTOR_GLOBAL +#include "syncthingconnector-devel-definitions.h" #include #ifdef LIB_SYNCTHING_CONNECTOR_STATIC diff --git a/syncthingmodel/global.h b/syncthingmodel/global.h index 1333dbf..e1060aa 100644 --- a/syncthingmodel/global.h +++ b/syncthingmodel/global.h @@ -4,6 +4,7 @@ #ifndef LIB_SYNCTHING_MODEL_GLOBAL #define LIB_SYNCTHING_MODEL_GLOBAL +#include "syncthingmodel-devel-definitions.h" #include #ifdef LIB_SYNCTHING_MODEL_STATIC diff --git a/syncthingwidgets/CMakeLists.txt b/syncthingwidgets/CMakeLists.txt index 91443da..16f337e 100644 --- a/syncthingwidgets/CMakeLists.txt +++ b/syncthingwidgets/CMakeLists.txt @@ -99,12 +99,14 @@ find_package(syncthingconnector ${META_APP_VERSION} REQUIRED) use_syncthingconnector(VISIBILITY PUBLIC) find_package(syncthingmodel ${META_APP_VERSION} REQUIRED) use_syncthingmodel(VISIBILITY PUBLIC) +find_package(syncthingtesthelper ${META_APP_VERSION} REQUIRED) +list(APPEND PRIVATE_INCLUDE_DIRS "${CMAKE_CURRENT_BINARY_DIR}/../testhelper/include") # configure libsyncthing option(USE_LIBSYNCTHING "whether libsyncthing should be included for the launcher" OFF) if (USE_LIBSYNCTHING) find_package(syncthing ${META_APP_VERSION} REQUIRED) - use_syncthing() + use_syncthing(VISIBILITY PUBLIC) list(APPEND META_PUBLIC_COMPILE_DEFINITIONS SYNCTHINGWIDGETS_USE_LIBSYNCTHING) endif () diff --git a/syncthingwidgets/global.h b/syncthingwidgets/global.h index 386d7eb..390547a 100644 --- a/syncthingwidgets/global.h +++ b/syncthingwidgets/global.h @@ -4,6 +4,7 @@ #ifndef SYNCTHINGWIDGETS_GLOBAL #define SYNCTHINGWIDGETS_GLOBAL +#include "syncthingwidgets-devel-definitions.h" #include #ifdef SYNCTHINGWIDGETS_STATIC diff --git a/testhelper/global.h b/testhelper/global.h index afc0058..c1c135e 100644 --- a/testhelper/global.h +++ b/testhelper/global.h @@ -4,6 +4,7 @@ #ifndef SYNCTHINGTESTHELPER_GLOBAL #define SYNCTHINGTESTHELPER_GLOBAL +#include "syncthingtesthelper-definitions.h" #include #ifdef SYNCTHINGTESTHELPER_STATIC