GN: Missing precompiled_header_type silently generates incorrect Ninja files
Reported by
t...@rnc-ag.de,
Sep 24 2016
|
||
Issue description
UserAgent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:49.0) Gecko/20100101 Firefox/49.0
Steps to reproduce the problem:
Simple PoC (this uses the toolchain in //tools/gn/example):
config("precompiled_headers") {
precompiled_header = "build/precompile.h"
precompiled_source = "//build/precompile.h"
}
executable("hello") {
sources = [
"hello.cc",
]
cflags_cc = [ "-std=gnu++14" ]
# If the following line is uncommented, the generated
# hello.ninja's cflags_cc variable will be empty (instead of -std=gnu++14).
configs += [ ":precompiled_headers" ]
}
What is the expected behavior?
Using a precompiled header, even though the toolchain doesn't support it, should lead to an error.
What went wrong?
If a target tries to use precompiled headers, but the toolchain's tool() for one of the used languages doesn't specify a precompiled_header_type,
the flags variable for that language (e.g. cflags_cc) will always be empty.
E.g.: The cxx tool has no precompiled_header_type variable -> Targets with C++ sources that use precompiled headers will always get an empty cflags_cc variable in the Ninja file.
Did this work before? No
Chrome version: <Copy from: 'about:version'> Channel: n/a
OS Version: 6.1 (Windows 7, Windows Server 2008 R2)
Flash Version: Shockwave Flash 23.0 r0
,
Oct 12 2017
Issue has not been modified or commented on in the last 365 days, please re-open or file a new bug if this is still an issue. For more details visit https://www.chromium.org/issue-tracking/autotriage - Your friendly Sheriffbot |
||
►
Sign in to add a comment |
||
Comment 1 by bugdroid1@chromium.org
, Oct 12 2016