mirror of
https://codeberg.org/ziglang/zig.git
synced 2025-12-06 05:44:20 +00:00
cmake: build stage3 by default
This is a simplification of the cmake build script which introduces a new "stage3" target that is built by default, which builds and installs a stage3 zig. It greatly simplifies the build instructions for Zig, making it conform to the regular cmake routine, while still producing a stage3 artifact.
This commit is contained in:
parent
5bb8c03697
commit
56129d26eb
4 changed files with 81 additions and 148 deletions
120
CMakeLists.txt
120
CMakeLists.txt
|
|
@ -12,7 +12,7 @@ if(NOT CMAKE_BUILD_TYPE)
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
if(NOT CMAKE_INSTALL_PREFIX)
|
if(NOT CMAKE_INSTALL_PREFIX)
|
||||||
set(CMAKE_INSTALL_PREFIX "${CMAKE_BINARY_DIR}/stage2" CACHE STRING
|
set(CMAKE_INSTALL_PREFIX "${CMAKE_BINARY_DIR}/stage3" CACHE STRING
|
||||||
"Directory to install zig to" FORCE)
|
"Directory to install zig to" FORCE)
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
|
|
@ -65,6 +65,9 @@ if("${ZIG_VERSION}" STREQUAL "")
|
||||||
endif()
|
endif()
|
||||||
message(STATUS "Configuring zig version ${ZIG_VERSION}")
|
message(STATUS "Configuring zig version ${ZIG_VERSION}")
|
||||||
|
|
||||||
|
set(ZIG_SKIP_INSTALL_LIB_FILES off CACHE BOOL
|
||||||
|
"Disable copying lib/ files to install prefix during the build phase")
|
||||||
|
|
||||||
set(ZIG_STATIC off CACHE BOOL "Attempt to build a static zig executable (not compatible with glibc)")
|
set(ZIG_STATIC off CACHE BOOL "Attempt to build a static zig executable (not compatible with glibc)")
|
||||||
set(ZIG_SHARED_LLVM off CACHE BOOL "Prefer linking against shared LLVM libraries")
|
set(ZIG_SHARED_LLVM off CACHE BOOL "Prefer linking against shared LLVM libraries")
|
||||||
set(ZIG_STATIC_LLVM off CACHE BOOL "Prefer linking against static LLVM libraries")
|
set(ZIG_STATIC_LLVM off CACHE BOOL "Prefer linking against static LLVM libraries")
|
||||||
|
|
@ -333,7 +336,7 @@ set(ZIG_CONFIG_H_OUT "${CMAKE_BINARY_DIR}/config.h")
|
||||||
set(ZIG_CONFIG_ZIG_OUT "${CMAKE_BINARY_DIR}/config.zig")
|
set(ZIG_CONFIG_ZIG_OUT "${CMAKE_BINARY_DIR}/config.zig")
|
||||||
|
|
||||||
# This is our shim which will be replaced by stage1.zig.
|
# This is our shim which will be replaced by stage1.zig.
|
||||||
set(ZIG0_SOURCES
|
set(ZIG1_SOURCES
|
||||||
"${CMAKE_SOURCE_DIR}/src/stage1/zig0.cpp"
|
"${CMAKE_SOURCE_DIR}/src/stage1/zig0.cpp"
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|
@ -373,9 +376,9 @@ set(ZIG_CPP_SOURCES
|
||||||
# https://github.com/ziglang/zig/issues/6363
|
# https://github.com/ziglang/zig/issues/6363
|
||||||
"${CMAKE_SOURCE_DIR}/src/windows_sdk.cpp"
|
"${CMAKE_SOURCE_DIR}/src/windows_sdk.cpp"
|
||||||
)
|
)
|
||||||
# Needed because we use cmake, not the zig build system, to build zig1.o.
|
# Needed because we use cmake, not the zig build system, to build zig2.o.
|
||||||
# This list is generated by building zig and then clearing the zig-cache directory,
|
# This list is generated by building zig and then clearing the zig-cache directory,
|
||||||
# then manually running the build-obj command (see BUILD_ZIG1_ARGS), and then looking
|
# then manually running the build-obj command (see BUILD_ZIG2_ARGS), and then looking
|
||||||
# in the zig-cache directory for the compiler-generated list of zig file dependencies.
|
# in the zig-cache directory for the compiler-generated list of zig file dependencies.
|
||||||
set(ZIG_STAGE2_SOURCES
|
set(ZIG_STAGE2_SOURCES
|
||||||
"${ZIG_CONFIG_ZIG_OUT}"
|
"${ZIG_CONFIG_ZIG_OUT}"
|
||||||
|
|
@ -942,40 +945,47 @@ if(MSVC OR MINGW)
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
if("${ZIG_EXECUTABLE}" STREQUAL "")
|
if("${ZIG_EXECUTABLE}" STREQUAL "")
|
||||||
add_executable(zig0 ${ZIG0_SOURCES})
|
add_executable(zig1 ${ZIG1_SOURCES})
|
||||||
set_target_properties(zig0 PROPERTIES
|
set_target_properties(zig1 PROPERTIES
|
||||||
COMPILE_FLAGS ${EXE_CFLAGS}
|
COMPILE_FLAGS ${EXE_CFLAGS}
|
||||||
LINK_FLAGS ${EXE_LDFLAGS}
|
LINK_FLAGS ${EXE_LDFLAGS}
|
||||||
)
|
)
|
||||||
target_link_libraries(zig0 zigstage1)
|
target_link_libraries(zig1 zigstage1)
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
if(MSVC)
|
if(MSVC)
|
||||||
set(ZIG1_OBJECT "${CMAKE_BINARY_DIR}/zig1.obj")
|
set(ZIG2_OBJECT "${CMAKE_BINARY_DIR}/zig2.obj")
|
||||||
else()
|
else()
|
||||||
set(ZIG1_OBJECT "${CMAKE_BINARY_DIR}/zig1.o")
|
set(ZIG2_OBJECT "${CMAKE_BINARY_DIR}/zig2.o")
|
||||||
endif()
|
endif()
|
||||||
if("${CMAKE_BUILD_TYPE}" STREQUAL "Debug")
|
if("${CMAKE_BUILD_TYPE}" STREQUAL "Debug")
|
||||||
set(ZIG1_RELEASE_ARG "")
|
set(ZIG_RELEASE_ARG "")
|
||||||
else()
|
else()
|
||||||
set(ZIG1_RELEASE_ARG -OReleaseFast --strip)
|
set(ZIG_RELEASE_ARG -Drelease)
|
||||||
|
endif()
|
||||||
|
if(ZIG_SKIP_INSTALL_LIB_FILES)
|
||||||
|
set(ZIG_SKIP_INSTALL_LIB_FILES_ARG "-Dskip-install-lib-files")
|
||||||
|
else()
|
||||||
|
set(ZIG_SKIP_INSTALL_LIB_FILES_ARG "-Dskip-install-lib-files=false")
|
||||||
endif()
|
endif()
|
||||||
if(ZIG_SINGLE_THREADED)
|
if(ZIG_SINGLE_THREADED)
|
||||||
set(ZIG1_SINGLE_THREADED_ARG "-fsingle-threaded")
|
set(ZIG_SINGLE_THREADED_ARG "-fsingle-threaded")
|
||||||
else()
|
else()
|
||||||
set(ZIG1_SINGLE_THREADED_ARG "")
|
set(ZIG_SINGLE_THREADED_ARG "")
|
||||||
|
endif()
|
||||||
|
if(ZIG_STATIC)
|
||||||
|
set(ZIG_STATIC_ARG "-Duse-zig-libcxx")
|
||||||
|
else()
|
||||||
|
set(ZIG_STATIC_ARG "")
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
set(BUILD_ZIG1_ARGS
|
set(BUILD_ZIG2_ARGS
|
||||||
"src/stage1.zig"
|
"src/stage1.zig"
|
||||||
-target "${ZIG_TARGET_TRIPLE}"
|
--name zig2
|
||||||
"-mcpu=${ZIG_TARGET_MCPU}"
|
|
||||||
--name zig1
|
|
||||||
--zig-lib-dir "${CMAKE_SOURCE_DIR}/lib"
|
--zig-lib-dir "${CMAKE_SOURCE_DIR}/lib"
|
||||||
"-femit-bin=${ZIG1_OBJECT}"
|
"-femit-bin=${ZIG2_OBJECT}"
|
||||||
-fcompiler-rt
|
-fcompiler-rt
|
||||||
"${ZIG1_RELEASE_ARG}"
|
"${ZIG_SINGLE_THREADED_ARG}"
|
||||||
"${ZIG1_SINGLE_THREADED_ARG}"
|
|
||||||
-lc
|
-lc
|
||||||
--pkg-begin build_options "${ZIG_CONFIG_ZIG_OUT}"
|
--pkg-begin build_options "${ZIG_CONFIG_ZIG_OUT}"
|
||||||
--pkg-end
|
--pkg-end
|
||||||
|
|
@ -985,68 +995,58 @@ set(BUILD_ZIG1_ARGS
|
||||||
|
|
||||||
if("${ZIG_EXECUTABLE}" STREQUAL "")
|
if("${ZIG_EXECUTABLE}" STREQUAL "")
|
||||||
add_custom_command(
|
add_custom_command(
|
||||||
OUTPUT "${ZIG1_OBJECT}"
|
OUTPUT "${ZIG2_OBJECT}"
|
||||||
COMMAND zig0 ${BUILD_ZIG1_ARGS}
|
COMMAND zig1 ${BUILD_ZIG2_ARGS}
|
||||||
DEPENDS zig0 "${ZIG_STAGE2_SOURCES}"
|
DEPENDS zig1 "${ZIG_STAGE2_SOURCES}"
|
||||||
COMMENT STATUS "Building self-hosted component ${ZIG1_OBJECT}"
|
COMMENT STATUS "Building stage2 object ${ZIG2_OBJECT}"
|
||||||
WORKING_DIRECTORY "${CMAKE_SOURCE_DIR}"
|
WORKING_DIRECTORY "${CMAKE_SOURCE_DIR}"
|
||||||
)
|
)
|
||||||
set(ZIG_EXECUTABLE "${zig_BINARY_DIR}/zig")
|
|
||||||
if (WIN32)
|
if (WIN32)
|
||||||
set(ZIG_EXECUTABLE "${ZIG_EXECUTABLE}.exe")
|
set(ZIG_EXECUTABLE "${zig2_BINARY_DIR}/zig2.exe")
|
||||||
|
else()
|
||||||
|
set(ZIG_EXECUTABLE "${zig2_BINARY_DIR}/zig2")
|
||||||
endif()
|
endif()
|
||||||
else()
|
else()
|
||||||
add_custom_command(
|
add_custom_command(
|
||||||
OUTPUT "${ZIG1_OBJECT}"
|
OUTPUT "${ZIG2_OBJECT}"
|
||||||
COMMAND "${ZIG_EXECUTABLE}" "build-obj" ${BUILD_ZIG1_ARGS}
|
COMMAND "${ZIG_EXECUTABLE}" "build-obj" ${BUILD_ZIG2_ARGS}
|
||||||
DEPENDS ${ZIG_STAGE2_SOURCES}
|
DEPENDS ${ZIG_STAGE2_SOURCES}
|
||||||
COMMENT STATUS "Building self-hosted component ${ZIG1_OBJECT}"
|
COMMENT STATUS "Building stage2 component ${ZIG2_OBJECT}"
|
||||||
WORKING_DIRECTORY "${CMAKE_SOURCE_DIR}"
|
WORKING_DIRECTORY "${CMAKE_SOURCE_DIR}"
|
||||||
)
|
)
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
# cmake won't let us configure an executable without C sources.
|
# cmake won't let us configure an executable without C sources.
|
||||||
add_executable(zig "${CMAKE_SOURCE_DIR}/src/stage1/empty.cpp" "${ZIG1_OBJECT}")
|
add_executable(zig2 "${CMAKE_SOURCE_DIR}/src/stage1/empty.cpp" "${ZIG2_OBJECT}")
|
||||||
|
|
||||||
set_target_properties(zig PROPERTIES
|
set_target_properties(zig2 PROPERTIES
|
||||||
COMPILE_FLAGS ${EXE_CFLAGS}
|
COMPILE_FLAGS ${EXE_CFLAGS}
|
||||||
LINK_FLAGS ${EXE_LDFLAGS}
|
LINK_FLAGS ${EXE_LDFLAGS}
|
||||||
)
|
)
|
||||||
target_link_libraries(zig zigstage1)
|
target_link_libraries(zig2 zigstage1)
|
||||||
if(MSVC)
|
if(MSVC)
|
||||||
target_link_libraries(zig ntdll.lib)
|
target_link_libraries(zig2 ntdll.lib)
|
||||||
elseif(MINGW)
|
elseif(MINGW)
|
||||||
target_link_libraries(zig ntdll)
|
target_link_libraries(zig2 ntdll)
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
install(TARGETS zig DESTINATION bin)
|
set(ZIG_INSTALL_ARGS "build"
|
||||||
|
|
||||||
set(ZIG_SKIP_INSTALL_LIB_FILES off CACHE BOOL
|
|
||||||
"Disable copying lib/ files to install prefix during the build phase")
|
|
||||||
|
|
||||||
if(NOT ZIG_SKIP_INSTALL_LIB_FILES)
|
|
||||||
set(ZIG_INSTALL_ARGS "build"
|
|
||||||
--zig-lib-dir "${CMAKE_SOURCE_DIR}/lib"
|
--zig-lib-dir "${CMAKE_SOURCE_DIR}/lib"
|
||||||
"-Dlib-files-only"
|
|
||||||
--prefix "${CMAKE_INSTALL_PREFIX}"
|
--prefix "${CMAKE_INSTALL_PREFIX}"
|
||||||
"-Dconfig_h=${ZIG_CONFIG_H_OUT}"
|
"-Dconfig_h=${ZIG_CONFIG_H_OUT}"
|
||||||
install
|
"-Denable-llvm"
|
||||||
)
|
"-Denable-stage1"
|
||||||
|
"${ZIG_RELEASE_ARG}"
|
||||||
|
"${ZIG_STATIC_ARG}"
|
||||||
|
"${ZIG_SKIP_INSTALL_LIB_FILES_ARG}"
|
||||||
|
"${ZIG_SINGLE_THREADED_ARG}"
|
||||||
|
"-Dtarget=${ZIG_TARGET_TRIPLE}"
|
||||||
|
"-Dcpu=${ZIG_TARGET_MCPU}"
|
||||||
|
)
|
||||||
|
|
||||||
# CODE has no effect with Visual Studio build system generator, therefore
|
add_custom_target(stage3 ALL
|
||||||
# when using Visual Studio build system generator we resort to running
|
COMMAND zig2 ${ZIG_INSTALL_ARGS}
|
||||||
# `zig build install` during the build phase.
|
DEPENDS zig2
|
||||||
if(MSVC)
|
COMMENT STATUS "Building stage3"
|
||||||
add_custom_target(zig_install_lib_files ALL
|
|
||||||
COMMAND zig ${ZIG_INSTALL_ARGS}
|
|
||||||
DEPENDS zig
|
|
||||||
WORKING_DIRECTORY "${CMAKE_SOURCE_DIR}"
|
WORKING_DIRECTORY "${CMAKE_SOURCE_DIR}"
|
||||||
)
|
)
|
||||||
else()
|
|
||||||
get_target_property(zig_BINARY_DIR zig BINARY_DIR)
|
|
||||||
install(CODE "set(zig_EXE \"${ZIG_EXECUTABLE}\")")
|
|
||||||
install(CODE "set(ZIG_INSTALL_ARGS \"${ZIG_INSTALL_ARGS}\")")
|
|
||||||
install(CODE "set(CMAKE_SOURCE_DIR \"${CMAKE_SOURCE_DIR}\")")
|
|
||||||
install(SCRIPT ${CMAKE_CURRENT_SOURCE_DIR}/cmake/install.cmake)
|
|
||||||
endif()
|
|
||||||
endif()
|
|
||||||
|
|
|
||||||
|
|
@ -20,12 +20,11 @@ export CXX="$OLD_ZIG c++ -target $TARGET -mcpu=$MCPU"
|
||||||
mkdir build-debug
|
mkdir build-debug
|
||||||
cd build-debug
|
cd build-debug
|
||||||
cmake .. \
|
cmake .. \
|
||||||
-DCMAKE_INSTALL_PREFIX="$DEBUG_STAGING" \
|
-DCMAKE_INSTALL_PREFIX="$(pwd)/stage3" \
|
||||||
-DCMAKE_PREFIX_PATH="$DEPS_LOCAL" \
|
-DCMAKE_PREFIX_PATH="$DEPS_LOCAL" \
|
||||||
-DCMAKE_BUILD_TYPE=Debug \
|
-DCMAKE_BUILD_TYPE=Debug \
|
||||||
-DZIG_TARGET_TRIPLE="$TARGET" \
|
|
||||||
-DZIG_TARGET_MCPU="$MCPU" \
|
|
||||||
-DZIG_STATIC=ON \
|
-DZIG_STATIC=ON \
|
||||||
|
-DZIG_USE_LLVM_CONFIG=OFF \
|
||||||
-GNinja
|
-GNinja
|
||||||
|
|
||||||
# Now cmake will use zig as the C/C++ compiler. We reset the environment variables
|
# Now cmake will use zig as the C/C++ compiler. We reset the environment variables
|
||||||
|
|
@ -35,21 +34,17 @@ unset CXX
|
||||||
|
|
||||||
ninja install
|
ninja install
|
||||||
|
|
||||||
cd $WORKSPACE
|
echo "Looking for non-conforming code formatting..."
|
||||||
|
stage3/bin/zig fmt --check .. \
|
||||||
"$DEBUG_STAGING/bin/zig" build -p stage3 -Denable-stage1 -Dstatic-llvm -Dtarget=native-native-musl --search-prefix "$DEPS_LOCAL"
|
--exclude ../test/cases/ \
|
||||||
|
--exclude ../build-debug \
|
||||||
|
--exclude ../build-release \
|
||||||
|
--exclude "$ZIG_LOCAL_CACHE_DIR" \
|
||||||
|
--exclude "$ZIG_GLOBAL_CACHE_DIR"
|
||||||
|
|
||||||
# simultaneously test building self-hosted without LLVM and with 32-bit arm
|
# simultaneously test building self-hosted without LLVM and with 32-bit arm
|
||||||
stage3/bin/zig build -Dtarget=arm-linux-musleabihf
|
stage3/bin/zig build -Dtarget=arm-linux-musleabihf
|
||||||
|
|
||||||
echo "Looking for non-conforming code formatting..."
|
|
||||||
stage3/bin/zig fmt --check . \
|
|
||||||
--exclude test/cases/ \
|
|
||||||
--exclude build-debug \
|
|
||||||
--exclude build-release \
|
|
||||||
--exclude "$ZIG_LOCAL_CACHE_DIR" \
|
|
||||||
--exclude "$ZIG_GLOBAL_CACHE_DIR"
|
|
||||||
|
|
||||||
stage3/bin/zig build test \
|
stage3/bin/zig build test \
|
||||||
-fqemu \
|
-fqemu \
|
||||||
-fwasmtime \
|
-fwasmtime \
|
||||||
|
|
|
||||||
|
|
@ -13,9 +13,8 @@ export CXX="$OLD_ZIG c++ -target $TARGET -mcpu=$MCPU"
|
||||||
|
|
||||||
mkdir build-release
|
mkdir build-release
|
||||||
cd build-release
|
cd build-release
|
||||||
STAGE2_PREFIX="$(pwd)/stage2"
|
|
||||||
cmake .. \
|
cmake .. \
|
||||||
-DCMAKE_INSTALL_PREFIX="$STAGE2_PREFIX" \
|
-DCMAKE_INSTALL_PREFIX="$RELEASE_STAGING" \
|
||||||
-DCMAKE_PREFIX_PATH="$DEPS_LOCAL" \
|
-DCMAKE_PREFIX_PATH="$DEPS_LOCAL" \
|
||||||
-DCMAKE_BUILD_TYPE=Release \
|
-DCMAKE_BUILD_TYPE=Release \
|
||||||
-DZIG_TARGET_TRIPLE="$TARGET" \
|
-DZIG_TARGET_TRIPLE="$TARGET" \
|
||||||
|
|
@ -30,31 +29,7 @@ unset CXX
|
||||||
|
|
||||||
ninja install
|
ninja install
|
||||||
|
|
||||||
# Here we rebuild zig but this time using the Zig binary we just now produced to
|
"$RELEASE_STAGING/bin/zig" build test docs \
|
||||||
# build zig1.o rather than relying on the one built with stage0. See
|
|
||||||
# https://github.com/ziglang/zig/issues/6830 for more details.
|
|
||||||
cmake .. -DZIG_EXECUTABLE="$STAGE2_PREFIX/bin/zig"
|
|
||||||
ninja install
|
|
||||||
|
|
||||||
# This is the binary we will distribute. We intentionally test this one in this
|
|
||||||
# script. If any test failures occur, hopefully they also occur in the debug
|
|
||||||
# version of this script for easier troubleshooting. This prevents distribution
|
|
||||||
# of a Zig binary that passes tests in debug mode but has a miscompilation in
|
|
||||||
# release mode.
|
|
||||||
"$STAGE2_PREFIX/bin/zig" build \
|
|
||||||
--prefix "$RELEASE_STAGING" \
|
|
||||||
--search-prefix "$DEPS_LOCAL" \
|
|
||||||
-Dstatic-llvm \
|
|
||||||
-Drelease \
|
|
||||||
-Dstrip \
|
|
||||||
-Dtarget="$TARGET" \
|
|
||||||
-Denable-stage1
|
|
||||||
|
|
||||||
cd $WORKSPACE
|
|
||||||
|
|
||||||
ZIG="$RELEASE_STAGING/bin/zig"
|
|
||||||
|
|
||||||
$ZIG build test docs \
|
|
||||||
-fqemu \
|
-fqemu \
|
||||||
-fwasmtime \
|
-fwasmtime \
|
||||||
-Dstatic-llvm \
|
-Dstatic-llvm \
|
||||||
|
|
@ -63,13 +38,13 @@ $ZIG build test docs \
|
||||||
|
|
||||||
# Produce the experimental std lib documentation.
|
# Produce the experimental std lib documentation.
|
||||||
mkdir -p "$RELEASE_STAGING/docs/std"
|
mkdir -p "$RELEASE_STAGING/docs/std"
|
||||||
$ZIG test lib/std/std.zig \
|
"$RELEASE_STAGING/bin/zig" test ../lib/std/std.zig \
|
||||||
--zig-lib-dir lib \
|
--zig-lib-dir lib \
|
||||||
-femit-docs=$RELEASE_STAGING/docs/std \
|
-femit-docs=$RELEASE_STAGING/docs/std \
|
||||||
-fno-emit-bin
|
-fno-emit-bin
|
||||||
|
|
||||||
cp LICENSE $RELEASE_STAGING/
|
cp ../LICENSE $RELEASE_STAGING/
|
||||||
cp zig-cache/langref.html $RELEASE_STAGING/docs/
|
cp ../zig-cache/langref.html $RELEASE_STAGING/docs/
|
||||||
|
|
||||||
# Look for HTML errors.
|
# Look for HTML errors.
|
||||||
tidy --drop-empty-elements no -qe $RELEASE_STAGING/docs/langref.html
|
tidy --drop-empty-elements no -qe $RELEASE_STAGING/docs/langref.html
|
||||||
|
|
|
||||||
|
|
@ -1,37 +0,0 @@
|
||||||
message("-- Installing: ${CMAKE_INSTALL_PREFIX}/lib")
|
|
||||||
|
|
||||||
if(NOT EXISTS ${zig_EXE})
|
|
||||||
message("::")
|
|
||||||
message(":: ERROR: Executable not found")
|
|
||||||
message(":: (execute_process)")
|
|
||||||
message("::")
|
|
||||||
message(":: executable: ${zig_EXE}")
|
|
||||||
message("::")
|
|
||||||
message(FATAL_ERROR)
|
|
||||||
endif()
|
|
||||||
|
|
||||||
execute_process(COMMAND ${zig_EXE} ${ZIG_INSTALL_ARGS}
|
|
||||||
WORKING_DIRECTORY ${CMAKE_SOURCE_DIR}
|
|
||||||
RESULT_VARIABLE _result
|
|
||||||
)
|
|
||||||
if(_result)
|
|
||||||
message("::")
|
|
||||||
message(":: ERROR: ${_result}")
|
|
||||||
message(":: (execute_process)")
|
|
||||||
|
|
||||||
string(REPLACE ";" " " s_INSTALL_LIBSTAGE2_ARGS "${ZIG_INSTALL_ARGS}")
|
|
||||||
message("::")
|
|
||||||
message(":: argv: ${zig_EXE} ${s_INSTALL_LIBSTAGE2_ARGS}")
|
|
||||||
|
|
||||||
set(_args ${zig_EXE} ${ZIG_INSTALL_ARGS})
|
|
||||||
list(LENGTH _args _len)
|
|
||||||
math(EXPR _len "${_len} - 1")
|
|
||||||
message("::")
|
|
||||||
foreach(_i RANGE 0 ${_len})
|
|
||||||
list(GET _args ${_i} _arg)
|
|
||||||
message(":: argv[${_i}]: ${_arg}")
|
|
||||||
endforeach()
|
|
||||||
|
|
||||||
message("::")
|
|
||||||
message(FATAL_ERROR)
|
|
||||||
endif()
|
|
||||||
Loading…
Add table
Reference in a new issue