commit
bba5c8a39a
109 files changed
+14085
No files matched your search
@@ -0,0 +1,30 @@
|
||||
# FindZig.cmake
|
||||
# Locates the zig compiler and exposes:
|
||||
# Zig_FOUND — TRUE if zig was found
|
||||
# Zig_EXECUTABLE — full path to the zig binary
|
||||
# Zig_VERSION — version string (e.g. "0.13.0")
|
||||
#
|
||||
# Minimum required version can be checked via find_package(Zig 0.13 REQUIRED).
|
||||
|
||||
find_program(Zig_EXECUTABLE
|
||||
NAMES zig
|
||||
DOC "Zig compiler"
|
||||
)
|
||||
|
||||
if(Zig_EXECUTABLE)
|
||||
execute_process(
|
||||
COMMAND "${Zig_EXECUTABLE}" version
|
||||
OUTPUT_VARIABLE Zig_VERSION
|
||||
OUTPUT_STRIP_TRAILING_WHITESPACE
|
||||
ERROR_QUIET
|
||||
)
|
||||
endif()
|
||||
|
||||
include(FindPackageHandleStandardArgs)
|
||||
find_package_handle_standard_args(Zig
|
||||
REQUIRED_VARS Zig_EXECUTABLE
|
||||
VERSION_VAR Zig_VERSION
|
||||
FAIL_MESSAGE "zig compiler not found. Install zig >= 0.13 from https://ziglang.org/download/"
|
||||
)
|
||||
|
||||
mark_as_advanced(Zig_EXECUTABLE)
|
||||
Reference in new issue
Block a user