authorgravatar for andrew@ziglang.orgAndrew Kelley <andrew@ziglang.org> 2023-07-22 11:03:01-07:00
committergravatar for andrew@ziglang.orgAndrew Kelley <andrew@ziglang.org> 2023-07-22 11:04:38-07:00
log32a175740c8750a7db550011795a4c22c0d0bc93
tree7b2fedda6b27176ca904f018a552d7d3f342563f
parent4bc90f17bb8cafeac84ba6ad6c6a4b4af9a3e091

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).

1 files changed, 8 insertions(+), 6 deletions(-)

CMakeLists.txt+8-6
......@@ -81,6 +81,8 @@ message(STATUS "Configuring zig version ${RESOLVED_ZIG_VERSION}")
8181set(ZIG_NO_LIB off CACHE BOOL
8282 "Disable copying lib/ files to install prefix during the build phase")
8383
84# This used to do something and it may or may not do something in the future.
85# Right now it does nothing.
8486set(ZIG_NO_LANGREF off CACHE BOOL
8587 "Disable copying of langref to the install prefix during the build phase")
8688
......@@ -828,11 +830,6 @@ if(ZIG_NO_LIB)
828830else()
829831 set(ZIG_NO_LIB_ARG "")
830832endif()
831if(ZIG_NO_LANGREF)
832 set(ZIG_NO_LANGREF_ARG "-Dno-langref")
833else()
834 set(ZIG_NO_LANGREF_ARG "")
835endif()
836833if(ZIG_SINGLE_THREADED)
837834 set(ZIG_SINGLE_THREADED_ARG "-Dsingle-threaded")
838835else()
......@@ -850,6 +847,10 @@ else()
850847 set(ZIG_PIE_ARG "")
851848endif()
852849
850# -Dno-langref is currently hardcoded because building the langref takes too damn long
851# -Dno-autodocs is currently hardcoded because the C backend generates a miscompilation
852# that prevents it from working.
853# To obtain these two forms of documentation, run zig build against stage3 rather than stage2.
853854set(ZIG_BUILD_ARGS
854855 --zig-lib-dir "${CMAKE_SOURCE_DIR}/lib"
855856 "-Dconfig_h=${ZIG_CONFIG_H_OUT}"
......@@ -857,7 +858,8 @@ set(ZIG_BUILD_ARGS
857858 ${ZIG_RELEASE_ARG}
858859 ${ZIG_STATIC_ARG}
859860 ${ZIG_NO_LIB_ARG}
860 ${ZIG_NO_LANGREF_ARG}
861 "-Dno-langref"
862 "-Dno-autodocs"
861863 ${ZIG_SINGLE_THREADED_ARG}
862864 ${ZIG_PIE_ARG}
863865 "-Dtarget=${ZIG_TARGET_TRIPLE}"