Skip to content

Commit 6d04f12

Browse files
kpumukJens-G
authored andcommitted
Fix CMake boost linking issue on AppVeyor MINGW
1 parent 4a21581 commit 6d04f12

File tree

1 file changed

+11
-0
lines changed

1 file changed

+11
-0
lines changed

build/cmake/BoostMacros.cmake

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,17 @@
1717
# under the License.
1818
#
1919

20+
# CMake 4.0+ removed the FindBoost module (CMP0167). Use OLD behavior to
21+
# preserve compatibility with existing ${Boost_LIBRARIES} usage.
22+
if(POLICY CMP0167)
23+
cmake_policy(SET CMP0167 OLD)
24+
endif()
25+
26+
# Force using FindBoost instead of Boost's own BoostConfig.cmake.
27+
# BoostConfig.cmake does not populate ${Boost_LIBRARIES} the same way,
28+
# which causes linking failures on Windows.
29+
set(Boost_NO_BOOST_CMAKE ON)
30+
2031
set(BOOST_MINREV 1.56)
2132

2233
macro(REQUIRE_BOOST_HEADERS)

0 commit comments

Comments
 (0)