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

Take CMAKE_CXX_FLAGS into account when detecting libcxx #252

Closed
wants to merge 1 commit into from

Conversation

robinlinden
Copy link

Hi! We're building for some obscure embedded platforms using sysroots and ran into an issue where conan fails to find string when trying to autodetect libcxx as it doesn't care about the CXX_FLAGS (where we pass --sysroot).

Just passing ${CMAKE_CXX_FLAGS} doesn't work since the compiler will get "-m32 --sysroot=..." as 1 argument instead of two, so I had to split them using separate_arguments.

@CLAassistant
Copy link

CLAassistant commented Jun 23, 2020

CLA assistant check
All committers have signed the CLA.

@robinlinden
Copy link
Author

If you want to be more selective in which flags are used, I'm fine with changing it so that it only grabs --sysroot from CMAKE_CXX_FLAGS.

@smessmer
Copy link
Contributor

This should probably also set the libcxx variable in PARENT_SCOPE, see #256

@czoido czoido closed this Jul 7, 2020
@czoido czoido reopened this Jul 7, 2020
@czoido
Copy link
Contributor

czoido commented Jul 10, 2020

Hi @robinlinden,
Thanks a lot for reporting and the contribution. I think this issue will be probably solved by #197 that is marked for review for version 0.16.
I'm going to close this as is duplicate but please feel free to reopen if you think it's necessary.

@czoido czoido closed this Jul 10, 2020
@puetzk
Copy link
Contributor

puetzk commented Jul 23, 2020

#197 doesn't parse it out of CXX_FLAGS (and I don't really think it should try), but it does handle sysroots if you set it the proper CMake way -- either -D or a toolchain which sets CMAKE_SYSROOT or CMAKE_SYSROOT_COMPILE/CMAKE_SYSROOT_LINK (if they need to be separate for some reason)

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

Successfully merging this pull request may close these issues.

5 participants