cotire icon indicating copy to clipboard operation
cotire copied to clipboard

cotire doesn't pull c++ language version from dependencies from target_link_libraries leading to PCH errors on build

Open xaxxon opened this issue 7 years ago • 2 comments

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.

xaxxon avatar Oct 12 '17 02:10 xaxxon

I can confirm this bug

Naios avatar Dec 08 '17 02:12 Naios

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'

dtmoodie avatar Apr 16 '19 15:04 dtmoodie