[cmake] avoid unnecessary rebuild when git commit id changes (#6881)

This commit removes the PACKAGE_VERSION definition from the global
config target so that when the git commit id is changed, only a few
sources will be re-compiled.
This commit is contained in:
Yakun Xu
2021-08-20 03:20:30 +08:00
committed by GitHub
parent d7749402f0
commit 12a9ca19a7
4 changed files with 12 additions and 1 deletions
-1
View File
@@ -101,7 +101,6 @@ if(OT_PACKAGE_VERSION STREQUAL "")
ot_git_version(OT_PACKAGE_VERSION)
message(STATUS "Setting default package version: ${OT_PACKAGE_VERSION}")
endif()
target_compile_definitions(ot-config INTERFACE "PACKAGE_VERSION=\"${OT_PACKAGE_VERSION}\"")
message(STATUS "Package Version: ${OT_PACKAGE_VERSION}")
set(OT_THREAD_VERSION "1.2" CACHE STRING "Thread version chosen by the user at configure time")