| author | |
| committer | |
| log | 0b99e5e4c42f3c9711f3a119711d584fa32a92a1 |
| tree | 1d68ddaf65fea370f481cf4d1676691cdf7e3223 |
| parent | f4f4e3388586e0c2e19d794725359e1b591f9a3e |
* 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 | 68 | - `make` is typically sufficient to build zig during development iterations. |
| 69 | 69 | - `make install` performs a build __and__ install. |
| 70 | 70 | - `msbuild -p:Configuration=Release INSTALL.vcxproj` on Windows performs a |
| 71 | build and install. To avoid install, pass cmake option `-DZIG_SKIP_INSTALL_LIB_FILES=ON`. | |
| 71 | build and install. To avoid install, pass cmake option `-DZIG_NO_LIB=ON`. | |
| 72 | 72 | |
| 73 | 73 | To test changes, do the following from the build directory: |
| 74 | 74 |
CMakeLists.txt+11-5| ... | ... | @@ -81,9 +81,15 @@ if("${ZIG_VERSION}" STREQUAL "") |
| 81 | 81 | endif() |
| 82 | 82 | message(STATUS "Configuring zig version ${ZIG_VERSION}") |
| 83 | 83 | |
| 84 | set(ZIG_SKIP_INSTALL_LIB_FILES off CACHE BOOL | |
| 84 | set(ZIG_NO_LIB off CACHE BOOL | |
| 85 | 85 | "Disable copying lib/ files to install prefix during the build phase") |
| 86 | 86 | |
| 87 | set(ZIG_SKIP_INSTALL_LIB_FILES off CACHE BOOL "Deprecated. Use ZIG_NO_LIB") | |
| 88 | if(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) | |
| 91 | endif() | |
| 92 | ||
| 87 | 93 | set(ZIG_STATIC off CACHE BOOL "Attempt to build a static zig executable (not compatible with glibc)") |
| 88 | 94 | set(ZIG_SHARED_LLVM off CACHE BOOL "Prefer linking against shared LLVM libraries") |
| 89 | 95 | set(ZIG_STATIC_LLVM off CACHE BOOL "Prefer linking against static LLVM libraries") |
| ... | ... | @@ -1004,10 +1010,10 @@ elseif("${CMAKE_BUILD_TYPE}" STREQUAL "RelWithDebInfo") |
| 1004 | 1010 | else() |
| 1005 | 1011 | set(ZIG_RELEASE_ARG -Drelease -Dstrip) |
| 1006 | 1012 | endif() |
| 1007 | if(ZIG_SKIP_INSTALL_LIB_FILES) | |
| 1008 | set(ZIG_SKIP_INSTALL_LIB_FILES_ARG "-Dskip-install-lib-files") | |
| 1013 | if(ZIG_NO_LIB) | |
| 1014 | set(ZIG_NO_LIB_ARG "-Dno-lib") | |
| 1009 | 1015 | else() |
| 1010 | set(ZIG_SKIP_INSTALL_LIB_FILES_ARG "-Dskip-install-lib-files=false") | |
| 1016 | set(ZIG_NO_LIB_ARG "") | |
| 1011 | 1017 | endif() |
| 1012 | 1018 | if(ZIG_SINGLE_THREADED) |
| 1013 | 1019 | set(ZIG_SINGLE_THREADED_ARG "-fsingle-threaded") |
| ... | ... | @@ -1080,7 +1086,7 @@ set(ZIG_BUILD_ARGS |
| 1080 | 1086 | "-Denable-stage1" |
| 1081 | 1087 | ${ZIG_RELEASE_ARG} |
| 1082 | 1088 | ${ZIG_STATIC_ARG} |
| 1083 | ${ZIG_SKIP_INSTALL_LIB_FILES_ARG} | |
| 1089 | ${ZIG_NO_LIB_ARG} | |
| 1084 | 1090 | ${ZIG_SINGLE_THREADED_ARG} |
| 1085 | 1091 | "-Dtarget=${ZIG_TARGET_TRIPLE}" |
| 1086 | 1092 | "-Dcpu=${ZIG_TARGET_MCPU}" |
build.zig+5-1| ... | ... | @@ -61,7 +61,11 @@ pub fn build(b: *Builder) !void { |
| 61 | 61 | const skip_stage1 = b.option(bool, "skip-stage1", "Main test suite skips stage1 compile error tests") orelse false; |
| 62 | 62 | const skip_run_translated_c = b.option(bool, "skip-run-translated-c", "Main test suite skips run-translated-c tests") orelse false; |
| 63 | 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; | |
| 65 | 69 | |
| 66 | 70 | const only_install_lib_files = b.option(bool, "lib-files-only", "Only install library files") orelse false; |
| 67 | 71 |