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

propagate libcxx flags to CMake consumers #105

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

svenevs
Copy link
Collaborator

@svenevs svenevs commented Jan 19, 2022

With clang, I think it would be nice to propagate the usage flags for libcxx. It enables a consuming project to do this:

cmake_minimum_required(VERSION 3.13 FATAL_ERROR)
project(nanogui-package-test)
set(CMAKE_CXX_STANDARD 17)
set(CMAKE_CXX_STANDARD_REQUIRED ON)
find_package(nanogui CONFIG REQUIRED)
add_executable(example2 example2.cpp)  # copied from nanogui
target_link_libraries(example2 PUBLIC nanogui)

Since nanogui will put these flags in automatically, it ends up being a usage requirement and currently the consumer needs to manually add back the libcxx flags from nanogui's CMakeLists.txt somehow.

An alternative would be to just set a variable in the package config file to at least make the flags that were used available to consumers if forcing it on the target seems like a bad idea for some reason.

Will likely create merge conflict with #104 so will rebase one or the other, both together were needed for me to use nanogui externally, I can't compile with gcc 11 on fedora for reasons that don't seem related to this project at all (something about missing attributes in X11 headers...). AKA I've tested this locally, but additional testing would be a good idea (especially on mac).

@wjakob wjakob force-pushed the master branch 11 times, most recently from e9c6fc9 to 0f47fe0 Compare October 27, 2022 21:06
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.

1 participant