Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

build: use parallelization except on Windows #17

Merged
merged 1 commit into from
Nov 3, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 10 additions & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -92,13 +92,23 @@ add_custom_command(
file(RELATIVE_PATH DOXYGEN_BUILD_DIR_RELATIVE "${SOURCE_DOCS_DIR}" "${DOXYGEN_BUILD_DIR_CMAKE}")
message(STATUS "DOXYGEN_BUILD_DIR_RELATIVE: ${DOXYGEN_BUILD_DIR_RELATIVE}")

if(CMAKE_HOST_WIN32)
# On Windows, we have to build the documentation using only a single thread to
# avoid the build mysteriously taking forever.
# See https://github.com/doxygen/doxygen/issues/9694
set(DOXYGEN_NUM_THREADS 1)
else()
set(DOXYGEN_NUM_THREADS 0)
endif()

# build docs
add_custom_target(docs ALL
COMMENT "Building Doxygen documentation"
WORKING_DIRECTORY "${SOURCE_DOCS_DIR}"
COMMAND ${CMAKE_COMMAND} -E env
READTHEDOCS_OUTPUT=${DOXYGEN_BUILD_DIR_RELATIVE}
READTHEDOCS_VERSION=${DOXYGEN_PROJECT_VERSION}
DOXYCONFIG_THREADS=${DOXYGEN_NUM_THREADS}
${DOXYGEN_EXECUTABLE} doxyconfig-Doxyfile
VERBATIM
DEPENDS FONT_AWESOME_FILES
Expand Down
7 changes: 5 additions & 2 deletions doxyconfig-Doxyfile
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,6 @@ DISABLE_INDEX = NO
DOCBOOK_OUTPUT = docbook
DOT_GRAPH_MAX_NODES = 50
DOT_IMAGE_FORMAT = svg
DOT_NUM_THREADS = 1
EXTRACT_ALL = NO
FULL_SIDEBAR = NO
GENERATE_HTML = YES
Expand All @@ -122,7 +121,11 @@ MACRO_EXPANSION = YES
MAN_OUTPUT = man
MARKDOWN_ID_STYLE = GITHUB
MARKDOWN_SUPPORT = YES
NUM_PROC_THREADS = 1
# If DOXYCONFIG_THREADS is not set in the environment, both DOT_NUM_THREADS and
# NUM_PROC_THREADS will be set to blank. A blank value for either is equivalent
# to the value of 0, i.e., multithreading will be used.
DOT_NUM_THREADS = $(DOXYCONFIG_THREADS)
NUM_PROC_THREADS = $(DOXYCONFIG_THREADS)
PROJECT_NUMBER = $(READTHEDOCS_VERSION)
OUTPUT_DIRECTORY = $(READTHEDOCS_OUTPUT)
RECURSIVE = YES
Expand Down