aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAvatar Benedikt Morbach <moben@exherbo.org> 2017-02-18 22:10:02 +0100
committerAvatar Bo ├śrsted Andresen <zlin@exherbo.org> 2017-02-19 18:06:15 +0000
commit1bbd4440fe4fb82a9ebd61d3f17b9ffa259eb17f (patch)
treea5051c67aaf424eeaebd14a996b095404fc82f0f
parente3aada5331bedfc97466967eaf1e65cb8dbf6943 (diff)
downloadpaludis-1bbd4440fe4fb82a9ebd61d3f17b9ffa259eb17f.tar.gz
paludis-1bbd4440fe4fb82a9ebd61d3f17b9ffa259eb17f.tar.xz
build: unbreak parallel makefile/docs generation
for real this time. See also http://stackoverflow.com/a/26211863 (did I mention that I hate cmake?) Change-Id: I7e58a7d0709543013b2d38772a277f4773cbe28a
-rw-r--r--src/clients/cave/CMakeLists.txt20
1 files changed, 16 insertions, 4 deletions
diff --git a/src/clients/cave/CMakeLists.txt b/src/clients/cave/CMakeLists.txt
index e471389..410119d 100644
--- a/src/clients/cave/CMakeLists.txt
+++ b/src/clients/cave/CMakeLists.txt
@@ -205,12 +205,18 @@ if(NOT USE_PREBUILT_DOCUMENTATION)
DEPENDS
"${PROJECT_SOURCE_DIR}/misc/asciidoc.conf"
"${CMAKE_CURRENT_BINARY_DIR}/cave.txt")
+ # without a target inbetween asciidoc and the consumers of the .xml, asciidoc will be run multiple times in parallel, leading to half-written .xml files and breaking parallel build.
+ add_custom_target(cave-xml-generator
+ DEPENDS
+ "${CMAKE_CURRENT_BINARY_DIR}/cave.xml"
+ COMMENT
+ "Checking if cave.xml needs to be generated")
add_custom_command(OUTPUT
"${CMAKE_CURRENT_BINARY_DIR}/cave.1"
COMMAND
xmlto man "${CMAKE_CURRENT_BINARY_DIR}/cave.xml"
DEPENDS
- "${CMAKE_CURRENT_BINARY_DIR}/cave.xml")
+ cave-xml-generator)
add_custom_command(OUTPUT
"${CMAKE_CURRENT_BINARY_DIR}/cave.html-man-fragment"
COMMAND
@@ -222,7 +228,7 @@ if(NOT USE_PREBUILT_DOCUMENTATION)
"${CMAKE_CURRENT_BINARY_DIR}/cave.html-man-fragment-dir/index.html"
"${CMAKE_CURRENT_BINARY_DIR}/cave.html-man-fragment-dir"
DEPENDS
- "${CMAKE_CURRENT_BINARY_DIR}/cave.xml")
+ cave-xml-generator)
foreach(subcommand ${CAVE_SUBCOMMANDS})
add_custom_command(OUTPUT
@@ -238,12 +244,18 @@ if(NOT USE_PREBUILT_DOCUMENTATION)
DEPENDS
"${PROJECT_SOURCE_DIR}/misc/asciidoc.conf"
"${CMAKE_CURRENT_BINARY_DIR}/cave-${subcommand}.txt")
+ # without a target inbetween asciidoc and the consumers of the .xml, asciidoc will be run multiple times in parallel, leading to half-written .xml files and breaking parallel build.
+ add_custom_target(cave-${subcommand}-xml-generator
+ DEPENDS
+ "${CMAKE_CURRENT_BINARY_DIR}/cave-${subcommand}.xml"
+ COMMENT
+ "Checking if cave-${subcommand}.xml needs to be generated")
add_custom_command(OUTPUT
"${CMAKE_CURRENT_BINARY_DIR}/cave-${subcommand}.1"
COMMAND
xmlto man "${CMAKE_CURRENT_BINARY_DIR}/cave-${subcommand}.xml"
DEPENDS
- "${CMAKE_CURRENT_BINARY_DIR}/cave-${subcommand}.xml")
+ cave-${subcommand}-xml-generator)
add_custom_command(OUTPUT
"${CMAKE_CURRENT_BINARY_DIR}/cave-${subcommand}.html-man-fragment"
COMMAND
@@ -255,7 +267,7 @@ if(NOT USE_PREBUILT_DOCUMENTATION)
"${CMAKE_CURRENT_BINARY_DIR}/cave-${subcommand}.html-man-fragment-dir/index.html"
"${CMAKE_CURRENT_BINARY_DIR}/cave-${subcommand}.html-man-fragment-dir"
DEPENDS
- "${CMAKE_CURRENT_BINARY_DIR}/cave-${subcommand}.xml")
+ cave-${subcommand}-xml-generator)
endforeach()
set(html-fragments "${CMAKE_CURRENT_BINARY_DIR}/cave.html-man-fragment")