Allow specifying build version using cmake
This commit is contained in:
parent
65991092f7
commit
d0a4110d34
@ -27,8 +27,10 @@ set(CMAKE_MODULE_PATH ${CMAKE_SOURCE_DIR}/cmake ${CMAKE_MODULE_PATH})
|
|||||||
set(ZIG_VERSION_MAJOR 0)
|
set(ZIG_VERSION_MAJOR 0)
|
||||||
set(ZIG_VERSION_MINOR 6)
|
set(ZIG_VERSION_MINOR 6)
|
||||||
set(ZIG_VERSION_PATCH 0)
|
set(ZIG_VERSION_PATCH 0)
|
||||||
set(ZIG_VERSION "${ZIG_VERSION_MAJOR}.${ZIG_VERSION_MINOR}.${ZIG_VERSION_PATCH}")
|
set(ZIG_VERSION "" CACHE STRING "Override Zig version string. Default is to find out with git.")
|
||||||
|
|
||||||
|
if("${ZIG_VERSION}" STREQUAL "")
|
||||||
|
set(ZIG_VERSION "${ZIG_VERSION_MAJOR}.${ZIG_VERSION_MINOR}.${ZIG_VERSION_PATCH}")
|
||||||
find_program(GIT_EXE NAMES git)
|
find_program(GIT_EXE NAMES git)
|
||||||
if(GIT_EXE)
|
if(GIT_EXE)
|
||||||
execute_process(
|
execute_process(
|
||||||
@ -47,6 +49,7 @@ if(GIT_EXE)
|
|||||||
endif()
|
endif()
|
||||||
endif()
|
endif()
|
||||||
endif()
|
endif()
|
||||||
|
endif()
|
||||||
message("Configuring zig version ${ZIG_VERSION}")
|
message("Configuring zig version ${ZIG_VERSION}")
|
||||||
|
|
||||||
set(ZIG_STATIC off CACHE BOOL "Attempt to build a static zig executable (not compatible with glibc)")
|
set(ZIG_STATIC off CACHE BOOL "Attempt to build a static zig executable (not compatible with glibc)")
|
||||||
|
Loading…
x
Reference in New Issue
Block a user