authorgravatar for andrew@ziglang.orgAndrew Kelley <andrew@ziglang.org> 2022-10-27 15:16:14-07:00
committergravatar for andrew@ziglang.orgAndrew Kelley <andrew@ziglang.org> 2022-10-27 15:18:00-07:00
log0b99e5e4c42f3c9711f3a119711d584fa32a92a1
tree1d68ddaf65fea370f481cf4d1676691cdf7e3223
parentf4f4e3388586e0c2e19d794725359e1b591f9a3e

build: rename the "skip lib files" option

* Old cmake option: `-DZIG_SKIP_INSTALL_LIB_FILES=ON` * New cmake option: `-DZIG_NO_LIB=ON` * Old build.zig option: `-Dskip-install-lib-files` * New build.zig option: `-Dno-lib` Motivation is making build commands easier to type.

3 files changed, 17 insertions(+), 7 deletions(-)

.github/CONTRIBUTING.md+1-1
...@@ -68,7 +68,7 @@ test and debug from a git working tree....@@ -68,7 +68,7 @@ test and debug from a git working tree.
68- `make` is typically sufficient to build zig during development iterations.68- `make` is typically sufficient to build zig during development iterations.
69- `make install` performs a build __and__ install.69- `make install` performs a build __and__ install.
70- `msbuild -p:Configuration=Release INSTALL.vcxproj` on Windows performs a70- `msbuild -p:Configuration=Release INSTALL.vcxproj` on Windows performs a
71build and install. To avoid install, pass cmake option `-DZIG_SKIP_INSTALL_LIB_FILES=ON`.71build and install. To avoid install, pass cmake option `-DZIG_NO_LIB=ON`.
7272
73To test changes, do the following from the build directory:73To test changes, do the following from the build directory:
7474
CMakeLists.txt+11-5
...@@ -81,9 +81,15 @@ if("${ZIG_VERSION}" STREQUAL "")...@@ -81,9 +81,15 @@ if("${ZIG_VERSION}" STREQUAL "")
81endif()81endif()
82message(STATUS "Configuring zig version ${ZIG_VERSION}")82message(STATUS "Configuring zig version ${ZIG_VERSION}")
8383
84set(ZIG_SKIP_INSTALL_LIB_FILES off CACHE BOOL84set(ZIG_NO_LIB off CACHE BOOL
85 "Disable copying lib/ files to install prefix during the build phase")85 "Disable copying lib/ files to install prefix during the build phase")
8686
87set(ZIG_SKIP_INSTALL_LIB_FILES off CACHE BOOL "Deprecated. Use ZIG_NO_LIB")
88if(ZIG_SKIP_INSTALL_LIB_FILES)
89 message(WARNING "ZIG_SKIP_INSTALL_LIB_FILES is deprecated. Use ZIG_NO_LIB instead.")
90 set(ZIG_NO_LIB ON)
91endif()
92
87set(ZIG_STATIC off CACHE BOOL "Attempt to build a static zig executable (not compatible with glibc)")93set(ZIG_STATIC off CACHE BOOL "Attempt to build a static zig executable (not compatible with glibc)")
88set(ZIG_SHARED_LLVM off CACHE BOOL "Prefer linking against shared LLVM libraries")94set(ZIG_SHARED_LLVM off CACHE BOOL "Prefer linking against shared LLVM libraries")
89set(ZIG_STATIC_LLVM off CACHE BOOL "Prefer linking against static LLVM libraries")95set(ZIG_STATIC_LLVM off CACHE BOOL "Prefer linking against static LLVM libraries")
...@@ -1004,10 +1010,10 @@ elseif("${CMAKE_BUILD_TYPE}" STREQUAL "RelWithDebInfo")...@@ -1004,10 +1010,10 @@ elseif("${CMAKE_BUILD_TYPE}" STREQUAL "RelWithDebInfo")
1004else()1010else()
1005 set(ZIG_RELEASE_ARG -Drelease -Dstrip)1011 set(ZIG_RELEASE_ARG -Drelease -Dstrip)
1006endif()1012endif()
1007if(ZIG_SKIP_INSTALL_LIB_FILES)1013if(ZIG_NO_LIB)
1008 set(ZIG_SKIP_INSTALL_LIB_FILES_ARG "-Dskip-install-lib-files")1014 set(ZIG_NO_LIB_ARG "-Dno-lib")
1009else()1015else()
1010 set(ZIG_SKIP_INSTALL_LIB_FILES_ARG "-Dskip-install-lib-files=false")1016 set(ZIG_NO_LIB_ARG "")
1011endif()1017endif()
1012if(ZIG_SINGLE_THREADED)1018if(ZIG_SINGLE_THREADED)
1013 set(ZIG_SINGLE_THREADED_ARG "-fsingle-threaded")1019 set(ZIG_SINGLE_THREADED_ARG "-fsingle-threaded")
...@@ -1080,7 +1086,7 @@ set(ZIG_BUILD_ARGS...@@ -1080,7 +1086,7 @@ set(ZIG_BUILD_ARGS
1080 "-Denable-stage1"1086 "-Denable-stage1"
1081 ${ZIG_RELEASE_ARG}1087 ${ZIG_RELEASE_ARG}
1082 ${ZIG_STATIC_ARG}1088 ${ZIG_STATIC_ARG}
1083 ${ZIG_SKIP_INSTALL_LIB_FILES_ARG}1089 ${ZIG_NO_LIB_ARG}
1084 ${ZIG_SINGLE_THREADED_ARG}1090 ${ZIG_SINGLE_THREADED_ARG}
1085 "-Dtarget=${ZIG_TARGET_TRIPLE}"1091 "-Dtarget=${ZIG_TARGET_TRIPLE}"
1086 "-Dcpu=${ZIG_TARGET_MCPU}"1092 "-Dcpu=${ZIG_TARGET_MCPU}"
build.zig+5-1
...@@ -61,7 +61,11 @@ pub fn build(b: *Builder) !void {...@@ -61,7 +61,11 @@ pub fn build(b: *Builder) !void {
61 const skip_stage1 = b.option(bool, "skip-stage1", "Main test suite skips stage1 compile error tests") orelse false;61 const skip_stage1 = b.option(bool, "skip-stage1", "Main test suite skips stage1 compile error tests") orelse false;
62 const skip_run_translated_c = b.option(bool, "skip-run-translated-c", "Main test suite skips run-translated-c tests") orelse false;62 const skip_run_translated_c = b.option(bool, "skip-run-translated-c", "Main test suite skips run-translated-c tests") orelse false;
63 const skip_stage2_tests = b.option(bool, "skip-stage2-tests", "Main test suite skips self-hosted compiler tests") orelse false;63 const skip_stage2_tests = b.option(bool, "skip-stage2-tests", "Main test suite skips self-hosted compiler tests") orelse false;
64 const skip_install_lib_files = b.option(bool, "skip-install-lib-files", "Do not copy lib/ files to installation prefix") orelse false;64 const deprecated_skip_install_lib_files = b.option(bool, "skip-install-lib-files", "deprecated. see no-lib") orelse false;
65 if (deprecated_skip_install_lib_files) {
66 std.log.warn("-Dskip-install-lib-files is deprecated in favor of -Dno-lib", .{});
67 }
68 const skip_install_lib_files = b.option(bool, "no-lib", "skip copying of lib/ files to installation prefix. Useful for development") orelse deprecated_skip_install_lib_files;
6569
66 const only_install_lib_files = b.option(bool, "lib-files-only", "Only install library files") orelse false;70 const only_install_lib_files = b.option(bool, "lib-files-only", "Only install library files") orelse false;
6771