Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

new failing test for check_function_exists in CMakeToolchain#18702

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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Draft
memsharded wants to merge1 commit intoconan-io:develop2
base:develop2
Choose a base branch
Loading
frommemsharded:test/cmaketoolchain_try_compile
Draft
Changes fromall commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
new failing test for check_function_exists in CMakeToolchain
  • Loading branch information
@memsharded
memsharded committedJul 29, 2025
commit825417868f5592e42cae47c2d471c2b06a04ad5a
37 changes: 37 additions & 0 deletionstest/functional/toolchains/cmake/test_cmake_toolchain.py
View file
Open in desktop
Original file line numberDiff line numberDiff line change
Expand Up@@ -2063,3 +2063,40 @@ def build(self):
else:
client.run("build . -s compiler.cppstd=11")
# It doesn't fail


@pytest.mark.skipif(platform.system() != "Windows", reason="Only for windows")
@pytest.mark.tool("cmake")
def test_cmaketoolchain_check_function_exists():
c = TestClient()
conanfile = textwrap.dedent("""
from conan import ConanFile
from conan.tools.cmake import CMake, CMakeToolchain
class Conan(ConanFile):
settings = "os", "compiler", "arch", "build_type"

def generate(self):
tc = CMakeToolchain(self)
# This gets back to older default behavior
# tc.blocks["try_compile"].values["config"] = None
tc.generate()

def build(self):
CMake(self).configure()
""")
consumer = textwrap.dedent("""
cmake_minimum_required(VERSION 3.15)
project(MyHello C)

include(CheckFunctionExists)
check_function_exists(pow HAVE_POW)
check_function_exists(sin HAVE_SIN)
if(NOT HAVE_POW OR NOT HAVE_SIN)
message(FATAL_ERROR "Not math!!!!!")
endif()
""")
c.save({"conanfile.py": conanfile,
"CMakeLists.txt": consumer})

c.run("build . ") # Release breaks the check
print(c.out)
Loading

[8]ページ先頭

©2009-2025 Movatter.jp