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

os.version still not defining CMAKE_OSX_DEPLOYMENT_TARGET in Macos in CMakeToolchain #9349

Closed
memsharded opened this issue Jul 30, 2021 · 4 comments · Fixed by #9498
Closed

Comments

@memsharded
Copy link
Member

I have -s os.version=10.9 in my conan create command. I confirmed that everything worked fine when my conanfile.py had tc.variables["CMAKE_OSX_DEPLOYMENT_TARGET"] = self.settings.os.version, but when I removed that code, -version-min show in the build output. Just tried with the release of 1.39.0 to double check and it's still an issue.

Originally posted by @ssrobins in #9282 (comment)

@franramirez688
Copy link
Contributor

@memsharded @ssrobins

I have performed this little test into my local conan repository. It looks like:

def test_cmake_osx_deployment_target():
    profile = textwrap.dedent("""
        [settings]
        arch=x86_64
        arch_build=x86_64
        build_type=Release
        compiler=apple-clang
        compiler.libcxx=libc++
        compiler.version=12.0
        os=Macos
        os.version=10.9
        os_build=Macos
        """)
    client = TestClient(path_with_spaces=False)

    conanfile = GenConanfile().with_settings("os", "arch", "compiler", "build_type")\
        .with_generator("CMakeToolchain")
    client.save({"conanfile.py": conanfile,
                "macos": profile})
    client.run("install . -pr macos")
    toolchain = client.load("conan_toolchain.cmake")
    assert 'set(CMAKE_OSX_DEPLOYMENT_TARGET 10.9)' in toolchain

And it's passing ok.
Apart from that, I did not get to reproduce it using the latest conan version. It worked using either -s os.version=10.9 in CLI or os.version=10.9 in profile.

@ssrobins is it still failing from your side? Am I missing anything?

@ssrobins
Copy link
Contributor

Still failing on my side.

I have a conan_v2 branch that has the explicit tc.variables["CMAKE_OSX_DEPLOYMENT_TARGET"] = self.settings.os.version setting and a conan_issue_9349 branch that doesn't:
ssrobins/conan-zlib@conan_v2...conan_issue_9349

Here's the compilation output from conan_issue_9349, notice -target is x86_64-apple-macos11.1:
image

Here's the equivalent output from conan_v2, notice -target is x86_64-apple-macos10.9, as I would expect:
image

@franramirez688
Copy link
Contributor

Thanks for your last report @ssrobins
It helped me a lot to figure out what was going on 👏

@ssrobins
Copy link
Contributor

ssrobins commented Sep 7, 2021

I see that it's now building correctly with 1.40.0, thanks so much for the fix!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants