cotire
cotire copied to clipboard
cotire doesn't pull c++ language version from dependencies from target_link_libraries leading to PCH errors on build
I have a interface library with
target_compile_features(MyLibrary INTERFACE cxx_std_17)
set on it.
elsewhere when I do an add_executable(MyExecutable and then target_link_library my MyLibrary interface library onto my executable, when I build it, I get the error while compiling the sources for MyExecutable
error: C++11 was disabled in PCH file but is currently enabled
if I explicitly put the C++ version on the MyExecutable with:
set_property(TARGET MyExecutable PROPERTY CXX_STANDARD 17)
then everything works, but that doesn't seem like it should be necessary since it's already being picked up for the build (just not the PCH build) by cmake.
I can confirm this bug
I too can confirm this bug.
I had trouble finding this so this is the error message I get on gcc 5.4:
__cplusplus' defined as
201402L' not ` 201103L'