Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add CMake include_guard() for cmake toolchain #8728

Merged
merged 2 commits into from Mar 29, 2021
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
11 changes: 8 additions & 3 deletions conan/tools/cmake/base.py
Expand Up @@ -71,10 +71,15 @@ class CMakeToolchainBase(object):

# Avoid including toolchain file several times (bad if appending to variables like
# CMAKE_CXX_FLAGS. See https://github.com/android/ndk/issues/323
if(CONAN_TOOLCHAIN_INCLUDED)
return()
if(${CMAKE_VERSION} VERSION_LESS "3.10")
if(CONAN_TOOLCHAIN_INCLUDED)
return()
endif()
set(CONAN_TOOLCHAIN_INCLUDED TRUE)
else()
include_guard()
endif()
uilianries marked this conversation as resolved.
Show resolved Hide resolved
set(CONAN_TOOLCHAIN_INCLUDED TRUE)


{% block before_try_compile %}
{# build_type (Release, Debug, etc) is only defined for single-config generators #}
Expand Down