diff options
author | Přemysl Eric Janouch <p@janouch.name> | 2021-10-24 15:11:52 +0200 |
---|---|---|
committer | Přemysl Eric Janouch <p@janouch.name> | 2021-10-24 15:31:03 +0200 |
commit | bc1dd64fdf84f6b9760fd8d69130dc5d964647bd (patch) | |
tree | 9fe2cdf01ee59acce5d8f077491188a37fd9ea85 | |
parent | 8c290df7b54999f72377376831414b8fa81071fa (diff) | |
download | logdiag-bc1dd64fdf84f6b9760fd8d69130dc5d964647bd.tar.gz logdiag-bc1dd64fdf84f6b9760fd8d69130dc5d964647bd.tar.xz logdiag-bc1dd64fdf84f6b9760fd8d69130dc5d964647bd.zip |
Partially unbreak the hopeless gtk-doc
GNOME Idiots Inc. keep breaking everything,
sometimes in coöperation with KitWare KludgeMakers Ltd.
-rw-r--r-- | CMakeLists.txt | 19 |
1 files changed, 14 insertions, 5 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt index 5db2c07..8310071 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -250,13 +250,22 @@ endif (BUILD_TESTING) # Generate documentation if (GTKDOC_FOUND) - # FIXME: not our bug but xml/gtkdocentities.ent cannot be passed - target_link_libraries (liblogdiag ${logdiag_LIBS}) + # Extracted LDFLAGS didn't contain -l in CMake 3.21.3 and gtk-doc 1.33.2, + # pass them explicitly and work around insanity; CMake still exits with + # an error and gtk-doc produces empty HTML documentation + string (REGEX REPLACE "(;)([^-])" "\\1-l\\2" xldflags "${logdiag_LIBS}") + set_target_properties (liblogdiag PROPERTIES LINK_LIBRARIES "") + + # The "official" module wants an XML file I don't want to give it + file (WRITE ${PROJECT_BINARY_DIR}/liblogdiag-docs-dummy.xml "<book/>") + + # XXX: not our bug but xml/gtkdocentities.ent cannot be passed + # XXX: this causes `make clean` to remove the entire build directory, + # because it marks CMAKE_CURRENT_BINARY_DIR as an output gtk_doc_add_module (liblogdiag SOURCE ${PROJECT_SOURCE_DIR}/liblogdiag - SUFFIXES c h - # The "official" module wants an XML file I don't want to give it - XML ${PROJECT_BINARY_DIR}/liblogdiag/liblogdiag-docs.xml + SUFFIXES c h LDFLAGS "-l${xldflags}" + XML ${PROJECT_BINARY_DIR}/liblogdiag-docs-dummy.xml LIBRARIES liblogdiag) endif () |