Commit graph

19 commits

Author SHA1 Message Date
Colin Cross
91e9004086 Support .asm files for assembly
Test: mmma -j external/libjpeg-turbo
Change-Id: Id192dae5d74ecbf500fc668931c37f9b91d25ca4
2016-12-02 21:12:30 -08:00
Dan Willemsen
d2ede879b5 Add basic VNDK support in Soong
Export a list of libraries in the VNDK, which is currently empty.

Take in Make's global BOARD_VNDK_VERSION, and use that as the SDK
version for modules that specify use_vndk: true.

Modules that use the vndk have some configuration as if they were
building against the NDK (the absence of globally defined headers), but
in other cases look like platform modules (using the platform libc++,
for now).

This change does not attempt to enforce any linking constraints, that
will come in a later patch.

Test: out/soong/build.ninja doesn't change
Change-Id: I3be206b67015ac5177b7eef4a451c579e3dc903f
2016-11-28 13:45:24 -08:00
Colin Cross
b668826a85 Move global cppflags to the beginning of cppflags
Global cppflags should come first so they can be overriden by module
cppflags.

Test: m -j checkbuild
Change-Id: I3454370a6b35f37982b1e0de2e0ec52b54974a8a
2016-11-22 15:41:09 -08:00
Dan Albert
ebedf678de Support sdk_version: "current" for the NDK.
We need to fall back to the old CRT objects since we aren't generating
those yet.

Test: Created a test module using "current", checked that it linked
      the libs from current.
Bug: None

Change-Id: I5fe170d7b26154da8877672ac2acb7da0262fe38
2016-11-10 14:01:08 -08:00
Dan Willemsen
273af7f3aa Add export_include_dirs to the local include path
Bug: 32641232
Test: ./soong builds compared before/after
Change-Id: If417a9f2278f42ffa524fccfd34f2b01a8cc9fb5
2016-11-07 22:31:32 +00:00
Colin Cross
0feb169460 Add proto property struct
The ProtoProperties struct was not being added to the property struct
list, preventing proto.type and proto.static properties from being set
in Android.bp files.

Bug: 32286026
Test: Add proto.type to system/extras/perfprofd/Android.bp, run soong
Change-Id: I9a5b63ddd3e7a53881ddbfd381c42aa1b4c4f454
2016-11-03 14:38:52 -07:00
Dan Willemsen
e1a3ce3609 Add yacc generated headers to the include path
Test: mmma -j system/tools/aidl
Change-Id: I444c7f2b004877e027f67e36e016b528511e1a32
2016-11-02 21:19:18 -07:00
Dan Willemsen
5cb580f407 Start using "struct Objects" to store object Paths
So that we can represent other files that get generated along with the
objects, like the gcno coverage information, and per-file clang-tidy
runs.

Test: Soong's build.ninja identical before/after
Change-Id: I5c553a153c436d5403549f62c73fe79c5f101779
2016-10-31 16:18:49 -07:00
Colin Cross
0c461f1f6e Add support for .proto files
.proto files are translated to .pb.cc and .pb.h files, which are then
compiled normally.

Bug: 32286026
Test: mmma -j system/extras/perfprofd
Change-Id: I538071424d667aacf35b4b8bfebe217f5f092726
2016-10-27 15:28:09 -07:00
Colin Cross
2f33635542 Simplify compileObjs
None of the direct users of compileObjs were using any of its
complexity (generated sources, excluded sources, extra sources).  Move
the complexity back in to baseCompiler.compile.

Test: m -j
Change-Id: I2e59d216682c00dd12a1395cf2448827d1c48023
2016-10-27 15:18:13 -07:00
Colin Cross
948f0cb9ea Allow disabling gnu extensions
Pass -std=c++14 instead of -std=gnu++14 (or whatever the current default
is) when "gnu_extensions: false" is specified in the blueprints files.

Bug: 32159540
Test: builds
Change-Id: If206228a972129d9574bcf50ddff283b7e7d3fd7
2016-10-18 12:41:17 -07:00
Colin Cross
6f6a428760 Consolidate -std flags
Define the default -std values in global.go, export them in makevars.go,
and use them in compiler.go.

Test: builds
Change-Id: Ia2ae01f63e182d0ad7f371e6d32184bff35a8897
2016-10-18 12:40:51 -07:00
Elliott Hughes
5a0401ab9c Consistently use -std=gnu99 for gcc as well as clang.
This matters for C files that are also built for Windows. Previously they'd
be compiled with -std=gnu99 for the host but [effectively] -std=gnu89 for
Windows.

Bug: http://b/32019064
Test: builds, and can build libcrypto_utils without a manual -std= line
Change-Id: I9c5cc7832220b5c3d6a007ff10d076e26fd8c75d
2016-10-13 14:41:31 +00:00
Colin Cross
4b963f8d6a Ninja and shell escape command line flags
Strings like cflags in Android.bp files are parsed by blueprint,
written to build.ninja files, parsed by ninja, and then passed to
/bin/sh -c.  This had resulted in a combination of blueprint
(\"), ninja ($$), and shell (\$) escaping being necessary.

Update Soong to automatically handle ninja and shell escaping in
cflags and ldflags.

Bug: 31221587
Test: m -j
Change-Id: Ibe087b2788b355b73c3225b5928870619a0a53bc
2016-09-29 15:57:59 -07:00
Colin Cross
1cfd89aca3 Split CommonGlobalIncludes for system includes
Split CommonGlobalSystemIncludes out of CommonGlobalIncludes in
preparation for moving global includes from -isystem to -I.

Bug: 31492149
Change-Id: Ib935ea038cdbf9515dc2ab68d7fff924c370906a
2016-09-15 09:33:57 -07:00
Colin Cross
b916a38233 Refactor cc modules to use decorators instead of inheritance
For example , instead of trying to have libraryLinker inherit from
baseLinker and libraryCompiler inherit from baseCompiler, create a
single decorator object that wraps both baseLinker and baseCompiler.

Test: Builds, no unexpected changes to build.ninja
Change-Id: I2468adaea8466c203a240259ba5694b8b1df7a52
2016-08-05 10:25:09 -07:00
Colin Cross
42742b8bb0 Rename compiler, linker and installer methods to be unique
compiler, linker, and installer interfaces may be implemented by a
single decorator object, rename their methods to be unique to avoid the
same method being called multiple times.

Test: out/soong/build.ninja unchanged
Change-Id: I1608c41cd68f614ba99c11bb9fcc7936f618d9aa
2016-08-01 13:47:15 -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
4d9c2d17c3 Separate cc.go
Split cc.go into files per module type, plus files for the compiler,
linker, and installer stages.

Change-Id: Id44c03f42fcd180950ccd008d4de0c144ea3597b
2016-07-29 15:17:58 -07:00