From 150b938b4922ec162bcb593c365e3d3616e0dbd7 Mon Sep 17 00:00:00 2001 From: John Firebaugh Date: Fri, 3 Feb 2017 15:59:42 -0800 Subject: [build, ios, macos] Simplify version portion of user agent string The X.Y.Z version portion was unreliable, as it pulled from the latest tag regardless of platform. Set version to 0.0.0 and retrieve only the hash, which allows us to drop the node/npm dependency. --- CMakeLists.txt | 12 ++++++++++++ 1 file changed, 12 insertions(+) (limited to 'CMakeLists.txt') diff --git a/CMakeLists.txt b/CMakeLists.txt index a48d544538..48c62007ee 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -27,6 +27,18 @@ if(IS_CI_BUILD) add_compile_options(-DCI_BUILD=1) endif() +if(EXISTS ${CMAKE_SOURCE_DIR}/.git/HEAD) + exec_program( + "git" + ${CMAKE_SOURCE_DIR} + ARGS "rev-parse --short=8 HEAD" + OUTPUT_VARIABLE MBGL_VERSION_REV ) +else() + set(MBGL_VERSION_REV 00000000) +endif() + +set_source_files_properties(src/mbgl/util/version.cpp PROPERTIES COMPILE_DEFINITIONS MBGL_VERSION_REV="${MBGL_VERSION_REV}") + mason_use(geometry VERSION 0.9.0 HEADER_ONLY) mason_use(variant VERSION 1.1.4 HEADER_ONLY) mason_use(unique_resource VERSION dev HEADER_ONLY) -- cgit v1.2.1