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

Don't impose C++14 on downstream projects #995

Merged
merged 1 commit into from
Apr 8, 2021
Merged
Changes from all 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
11 changes: 10 additions & 1 deletion cmake/LibraryDefine.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,16 @@ function(OPENEXR_DEFINE_LIBRARY libname)
${OPENEXR_CURLIB_HEADERS}
${OPENEXR_CURLIB_SOURCES})

target_compile_features(${objlib} PUBLIC cxx_std_${OPENEXR_CXX_STANDARD})
# Use ${OPENEXR_CXX_STANDARD} to determine the standard we use to compile
# OpenEXR itself. But the headers only require C++11 features, so that's
# all we need to pass on as interface reqirements to downstream projects.
# For example, it's fine for an OpenEXR built with C++14 to be called from
# an app that is compiled with C++11; OpenEXR needn't force the app to
# also use C++14.
target_compile_features(${objlib}
PRIVATE cxx_std_${OPENEXR_CXX_STANDARD}
INTERFACE cxx_std_11 )
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

i did not know this is possible.


if(OPENEXR_CURLIB_PRIV_EXPORT AND BUILD_SHARED_LIBS)
target_compile_definitions(${objlib} PRIVATE ${OPENEXR_CURLIB_PRIV_EXPORT})
if(WIN32)
Expand Down