Commit graph

9 commits

Author SHA1 Message Date
Jiyong Park
d08b697828 Allow macro definition with space
cflags: ["-DMACRO=\" definition \""] should not be rejected.

Bug: 66914194
Test: TestCompilerFlags in cc_test.go

Change-Id: I7f96505a83898616415ef1fb7e13596b56a063f3
2017-10-19 22:39:32 +09:00
Dan Willemsen
17ff636322 Ban --coverage now that we have native coverage
Bug: 32749731
Test: m -j
Change-Id: Icb6ca0d846cba0ca842d3fb12dde1f1e8701cf5d
2017-02-14 13:05:48 -08:00
Dan Willemsen
a03cf6d322 Add clang-tidy support
For every file which we can run clang-tidy (C/C++ clang-built), we add a
new build node that depends on the object file (since clang-tidy does
not export a depfile), and is depended on by the link step. This is
better than how we're doing it in make, since calling tidy can be turned
on or off without needing to rebuild the object files.

This does not attempt to port WITH_TIDY_ONLY from Make, since the way
that it works is broken (due to the lack of a depfile).

Bug: 32244182
Test: WITH_TIDY=true mmma -j bionic/libc
Test: ./soong (Setting ClangTidy: true)
Change-Id: I40bbb5bb00d292d72bf1c293b93080b5f9f6d8ea
2016-10-31 16:21:01 -07:00
Colin Cross
42d1ba2d92 Add -z to valid multi-word linker flags
Art uses -z muldefs, allow it to be passed as a property.

Change-Id: Ief3b252d4b84762dbd49766ecdbebe00b333f523
2016-09-07 13:15:25 -07:00
Josh Gao
92da2b5e99 Allow darwin targets to use -framework CoreFoundation.
Bug: http://b/31245118
Change-Id: I5aa6162715b643af4a3073e6e403a6e1729f7c15
2016-09-01 11:53:42 -07:00
Colin Cross
b98c8b0595 Move toolchain and global variables into separate package
Move all of the configuration into a cc/config package

Change-Id: If56fc7242062ed1ce3cb297f78a1e0ef7537373c
2016-08-01 13:37:01 -07:00
Colin Cross
76fada06c6 Finish cc.Customizer
The Customizer interface now provides a Flags method that takes a
CustomizerFlagsContext and can call AppendCflags to insert extra cflags
on a module.

Change-Id: I821242e7574e8ff653580325d1bef2998a50e29c
2016-07-27 17:15:49 -07:00
Dan Willemsen
58f9bb1160 androidmk: Support version_script
This only translates the common case using $(LOCAL_PATH). If it doesn't
match here, Soong will throw an error with a suggested fix.

Change-Id: If64c8fca008a1a414fc12389e6b1bb40af0df899
2016-06-03 13:56:55 -07:00
Dan Willemsen
20acc5c520 Add flag property checking
Some checks for common errors with user-provided compiler and linker
flags:

* Using -I instead of include_dirs
* Using -l<lib> in ldflags instead of host_ldlibs (or shared_libs)
* Using -L in ldflags
* Splitting a multi-word flag into two flags
* Combining two flags into one list entry
* Using a path that could search outside the source or output trees
* Using a non-whitelisted library in host_ldlibs

Maybe some of the flag checks should happen during a static analysis
pass, but we don't have one right now, and this only adds ~1/2 second to
our 73 second Mega_device runs (recompile the changed code, run
soong_build, then report unknown target).

Change-Id: Icea7436260f1caa62c0cec29817a1cfea27b3e7c
2016-05-25 17:50:05 -07:00