From 32a175740c8750a7db550011795a4c22c0d0bc93 Mon Sep 17 00:00:00 2001 From: Andrew Kelley Date: Sat, 22 Jul 2023 11:03:01 -0700 Subject: [PATCH] cmake: don't ask zig2 to do hard things Apparently hard things: * run autodoc on the std lib * build the langref If any zig distros want these documentation, they'll need to get them from a stage3 `zig build` instead of stage2 (LLVM backend instead of C backend). --- CMakeLists.txt | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 7cd315377f..f57d67655a 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -81,6 +81,8 @@ message(STATUS "Configuring zig version ${RESOLVED_ZIG_VERSION}") set(ZIG_NO_LIB off CACHE BOOL "Disable copying lib/ files to install prefix during the build phase") +# This used to do something and it may or may not do something in the future. +# Right now it does nothing. set(ZIG_NO_LANGREF off CACHE BOOL "Disable copying of langref to the install prefix during the build phase") @@ -828,11 +830,6 @@ if(ZIG_NO_LIB) else() set(ZIG_NO_LIB_ARG "") endif() -if(ZIG_NO_LANGREF) - set(ZIG_NO_LANGREF_ARG "-Dno-langref") -else() - set(ZIG_NO_LANGREF_ARG "") -endif() if(ZIG_SINGLE_THREADED) set(ZIG_SINGLE_THREADED_ARG "-Dsingle-threaded") else() @@ -850,6 +847,10 @@ else() set(ZIG_PIE_ARG "") endif() +# -Dno-langref is currently hardcoded because building the langref takes too damn long +# -Dno-autodocs is currently hardcoded because the C backend generates a miscompilation +# that prevents it from working. +# To obtain these two forms of documentation, run zig build against stage3 rather than stage2. set(ZIG_BUILD_ARGS --zig-lib-dir "${CMAKE_SOURCE_DIR}/lib" "-Dconfig_h=${ZIG_CONFIG_H_OUT}" @@ -857,7 +858,8 @@ set(ZIG_BUILD_ARGS ${ZIG_RELEASE_ARG} ${ZIG_STATIC_ARG} ${ZIG_NO_LIB_ARG} - ${ZIG_NO_LANGREF_ARG} + "-Dno-langref" + "-Dno-autodocs" ${ZIG_SINGLE_THREADED_ARG} ${ZIG_PIE_ARG} "-Dtarget=${ZIG_TARGET_TRIPLE}"