diff --git a/libc/CMakeLists.txt b/libc/CMakeLists.txt index 2d474f08841c..7a5ed88ef054 100644 --- a/libc/CMakeLists.txt +++ b/libc/CMakeLists.txt @@ -216,7 +216,7 @@ foreach(opt IN LISTS global_config) message(STATUS "${opt_name}: ${opt_value}") set(${opt_name} ${opt_value}) endforeach() -generate_config_doc(${main_config_file} ${LIBC_SOURCE_DIR}/docs/configure.rst) +generate_config_doc(${main_config_file} ${LIBC_BUILD_DIR}/docs/configure.rst) # Load each target specific config. foreach(config_path IN LISTS LIBC_CONFIG_JSON_FILE_LIST) diff --git a/libc/cmake/modules/LibcConfig.cmake b/libc/cmake/modules/LibcConfig.cmake index da166dd6cc3f..19bdf44d96bf 100644 --- a/libc/cmake/modules/LibcConfig.cmake +++ b/libc/cmake/modules/LibcConfig.cmake @@ -139,6 +139,8 @@ function(generate_config_doc config_file doc_file) if(NOT EXISTS ${config_file}) message(FATAL_ERROR "${config_file} does not exist") endif() + get_filename_component(doc_dir ${doc_file} DIRECTORY) + file(MAKE_DIRECTORY ${doc_dir}) file(READ ${config_file} json_config) string(JSON group_count ERROR_VARIABLE json_error LENGTH ${json_config}) if(json_error) diff --git a/libc/docs/configure.rst b/libc/docs/configure.rst deleted file mode 100644 index 06d20df261bc..000000000000 --- a/libc/docs/configure.rst +++ /dev/null @@ -1,80 +0,0 @@ -.. _configure: -.. - Do not edit this file directly. CMake will auto generate it. - If the changes are intended, add this file to your commit. - -========================== -Configure Options -========================== - -Below is the full set of options one can use to configure the libc build. -An option can be given an explicit value on the CMake command line using -the following syntax: - -.. code-block:: sh - - $> cmake -D=