Skip to content

Commit

Permalink
fix(dlog): JournalAppender not work
Browse files Browse the repository at this point in the history
BUILD_WITH_SYSTEMD not defined
  • Loading branch information
kegechen committed Oct 18, 2024
1 parent 280791d commit 918c40f
Show file tree
Hide file tree
Showing 5 changed files with 7 additions and 11 deletions.
1 change: 1 addition & 0 deletions archlinux/PKGBUILD
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ build() {
-GNinja \
-DMKSPECS_INSTALL_DIR=lib/qt/mkspecs/modules \
-DBUILD_DOCS=ON \
-DBUILD_WITH_SYSTEMD=ON \
-DBUILD_EXAMPLES=OFF \
-DQCH_INSTALL_DESTINATION=share/doc/qt \
-DCMAKE_INSTALL_LIBDIR=lib \
Expand Down
2 changes: 1 addition & 1 deletion debian/rules
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ endif
dh $@

override_dh_auto_configure:
dh_auto_configure -- -DBUILD_EXAMPLES=OFF -DBUILD_DOCS=ON -DBUILD_VERSION=$(BUILD_VER) -DDTK_VERSION=$(PACK_VER) -DD_DSG_APP_DATA_FALLBACK=/var/dsg/appdata
dh_auto_configure -- -DBUILD_WITH_SYSTEMD=ON -DBUILD_EXAMPLES=OFF -DBUILD_DOCS=ON -DBUILD_VERSION=$(BUILD_VER) -DDTK_VERSION=$(PACK_VER) -DD_DSG_APP_DATA_FALLBACK=/var/dsg/appdata

#override_dh_auto_test:
# echo "skip auto test"
Expand Down
3 changes: 3 additions & 0 deletions dtkcore.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,9 @@ if(UNIX AND NOT APPLE)
endif()

set (BUILD_WITH_SYSTEMD OFF CACHE BOOL "Build with systemd")
if (BUILD_WITH_SYSTEMD)
add_definitions(-DBUILD_WITH_SYSTEMD)
endif()

set(CMAKE_CXX_STANDARD 17)

Expand Down
2 changes: 2 additions & 0 deletions src/log/LogManager.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -149,6 +149,8 @@ void DLogManager::initJournalAppender()
Q_D(DLogManager);
d->m_journalAppender = new JournalAppender();
dlogger->registerAppender(d->m_journalAppender);
#else
qWarning() << "BUILD_WITH_SYSTEMD not defined or OS not support!!";
#endif
}

Expand Down
10 changes: 0 additions & 10 deletions tests/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -21,9 +21,6 @@ if(LINUX)
if("${QT_VERSION_MAJOR}" STREQUAL "5")
pkg_check_modules(QGSettings REQUIRED IMPORTED_TARGET gsettings-qt)
endif()
if(BUILD_WITH_SYSTEMD)
pkg_check_modules(Systemd REQUIRED IMPORTED_TARGET libsystemd)
endif()
endif()

find_package(Qt${QT_VERSION_MAJOR} REQUIRED COMPONENTS Xml)
Expand Down Expand Up @@ -88,13 +85,6 @@ if(LINUX)
)
endif()

if(BUILD_WITH_SYSTEMD)
target_link_libraries(
${BIN_NAME} PRIVATE
PkgConfig::Systemd
)
endif()

target_link_libraries(
${BIN_NAME} PRIVATE
Qt${QT_VERSION_MAJOR}::DBus
Expand Down

0 comments on commit 918c40f

Please sign in to comment.