File tree Expand file tree Collapse file tree 1 file changed +8
-1
lines changed Expand file tree Collapse file tree 1 file changed +8
-1
lines changed Original file line number Diff line number Diff line change @@ -111,6 +111,8 @@ set(ZIG_TARGET_TRIPLE "native" CACHE STRING "arch-os-abi to output binaries for"
111111set (ZIG_TARGET_MCPU "native" CACHE STRING "-mcpu parameter to output binaries for" )
112112set (ZIG_SINGLE_THREADED off CACHE BOOL "limit the zig compiler to use only 1 thread" )
113113set (ZIG_AR_WORKAROUND off CACHE BOOL "append 'ar' subcommand to CMAKE_AR" )
114+ set (ZIG_DYNAMIC_LINKER "" CACHE STRING
115+ "Override the dynamic linker used by the Zig binary. Default is to auto-detect the dynamic linker." )
114116
115117if ("${ZIG_TARGET_TRIPLE} " STREQUAL "native" )
116118 set (ZIG_USE_LLVM_CONFIG ON CACHE BOOL "use llvm-config to find LLVM libraries" )
@@ -897,12 +899,16 @@ if(ZIG_STATIC AND NOT MSVC)
897899else ()
898900 set (ZIG_STATIC_ARG "" )
899901endif ()
900-
901902if (CMAKE_POSITION_INDEPENDENT_CODE OR ZIG_PIE)
902903 set (ZIG_PIE_ARG "-Dpie" )
903904else ()
904905 set (ZIG_PIE_ARG "" )
905906endif ()
907+ if ("${ZIG_DYNAMIC_LINKER} " STREQUAL "" )
908+ set (ZIG_DYNAMIC_LINKER_ARG "" )
909+ else ()
910+ set (ZIG_DYNAMIC_LINKER_ARG "-Ddynamic-linker=${ZIG_DYNAMIC_LINKER} " )
911+ endif ()
906912
907913# -Dno-langref is currently hardcoded because building the langref takes too damn long
908914# To obtain these two forms of documentation, run zig build against stage3 rather than stage2.
@@ -918,6 +924,7 @@ set(ZIG_BUILD_ARGS
918924 ${ZIG_PIE_ARG}
919925 "-Dtarget=${ZIG_TARGET_TRIPLE} "
920926 "-Dcpu=${ZIG_TARGET_MCPU} "
927+ ${ZIG_DYNAMIC_LINKER_ARG}
921928 "-Dversion-string=${RESOLVED_ZIG_VERSION} "
922929)
923930
You can’t perform that action at this time.
0 commit comments