| ... | ... | @@ -109,6 +109,8 @@ endif() |
| 109 | 109 | |
| 110 | 110 | set(ZIG_TARGET_TRIPLE "native" CACHE STRING "arch-os-abi to output binaries for") |
| 111 | 111 | set(ZIG_TARGET_MCPU "native" CACHE STRING "-mcpu parameter to output binaries for") |
| 112 | set(ZIG_TARGET_DYNAMIC_LINKER "" CACHE STRING |
| 113 | "Override the dynamic linker used by the Zig binary. Default is to auto-detect the dynamic linker.") |
| 112 | 114 | set(ZIG_SINGLE_THREADED off CACHE BOOL "limit the zig compiler to use only 1 thread") |
| 113 | 115 | set(ZIG_AR_WORKAROUND off CACHE BOOL "append 'ar' subcommand to CMAKE_AR") |
| 114 | 116 | |
| ... | ... | @@ -897,12 +899,16 @@ if(ZIG_STATIC AND NOT MSVC) |
| 897 | 899 | else() |
| 898 | 900 | set(ZIG_STATIC_ARG "") |
| 899 | 901 | endif() |
| 900 | | |
| 901 | 902 | if(CMAKE_POSITION_INDEPENDENT_CODE OR ZIG_PIE) |
| 902 | 903 | set(ZIG_PIE_ARG "-Dpie") |
| 903 | 904 | else() |
| 904 | 905 | set(ZIG_PIE_ARG "") |
| 905 | 906 | endif() |
| 907 | if("${ZIG_TARGET_DYNAMIC_LINKER}" STREQUAL "") |
| 908 | set(ZIG_DYNAMIC_LINKER_ARG "") |
| 909 | else() |
| 910 | set(ZIG_DYNAMIC_LINKER_ARG "-Ddynamic-linker=${ZIG_TARGET_DYNAMIC_LINKER}") |
| 911 | endif() |
| 906 | 912 | |
| 907 | 913 | # -Dno-langref is currently hardcoded because building the langref takes too damn long |
| 908 | 914 | # To obtain these two forms of documentation, run zig build against stage3 rather than stage2. |
| ... | ... | @@ -918,6 +924,7 @@ set(ZIG_BUILD_ARGS |
| 918 | 924 | ${ZIG_PIE_ARG} |
| 919 | 925 | "-Dtarget=${ZIG_TARGET_TRIPLE}" |
| 920 | 926 | "-Dcpu=${ZIG_TARGET_MCPU}" |
| 927 | ${ZIG_DYNAMIC_LINKER_ARG} |
| 921 | 928 | "-Dversion-string=${RESOLVED_ZIG_VERSION}" |
| 922 | 929 | ) |
| 923 | 930 | |