Skip to content

Commit a8dd7b0

Browse files
authored
glog: WITH_UNWIND=OFF ignored with 0.7.1, need to set none (#844)
The `WITH_UNWIND=OFF` flag is ignored with `glog` `0.7.1`. One needs to set `none` now to disable the usage of `libunwind`. Furthermore make older glog versions compatible with CMake 4.0 and newer.
1 parent 68c2371 commit a8dd7b0

1 file changed

Lines changed: 13 additions & 1 deletion

File tree

cmake/projects/glog/hunter.cmake

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -108,12 +108,24 @@ hunter_add_version(
108108
470e77edcaad491d2f676987ac5a2e739978dda5
109109
)
110110

111+
if(HUNTER_glog_VERSION VERSION_GREATER_EQUAL 0.7.1)
112+
set(_hunter_glog_with_unwind_off_flag "none")
113+
else()
114+
set(_hunter_glog_with_unwind_off_flag "OFF")
115+
endif()
116+
if(HUNTER_glog_VERSION VERSION_LESS 0.7.1)
117+
# CMake 4.0+ compatibility with older Glog packages
118+
set(_hunter_glog_cmake_compatibility_flag "CMAKE_POLICY_VERSION_MINIMUM=3.5")
119+
else()
120+
set(_hunter_glog_cmake_compatibility_flag "")
121+
endif()
111122
# explicitly remove dependency on gflags (only needed for tests)
112123
hunter_cmake_args(glog CMAKE_ARGS
113124
WITH_GFLAGS=OFF
114-
WITH_UNWIND=OFF # since 0.5.0
125+
WITH_UNWIND=${_hunter_glog_with_unwind_off_flag} # since 0.5.0
115126
WITH_GTEST=OFF # since 0.6.0
116127
BUILD_TESTING=OFF
128+
${_hunter_glog_cmake_compatibility_flag}
117129
)
118130

119131
hunter_pick_scheme(DEFAULT url_sha1_cmake)

0 commit comments

Comments
 (0)