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