Commit graph

25 commits

Author SHA1 Message Date
Dan Willemsen
300151ba19 Always use the standard OSX SDK tools
Instead of whatever happens to be in PATH.

Test: port install gcc5; attempt to build host binaries
Change-Id: If4af32596edd6fd3e459c3d574ab0ff495f236ff
2017-03-13 12:40:30 -07:00
Fabien Sanglard
d61f1f4559 Add support for CMakefile generation
Test: Manually generated CMakeLists.txt for gui/ui/aapt2.

Change-Id: I7dedc300c1e50b8e39bc58091b650c0bbe2c62da
2017-02-07 09:43:02 -08:00
Dan Albert
043833ca81 Add c_std and cpp_std properties.
Test: Checked showcommands ouput for each setting.
Bug: None
Change-Id: Ibe02352f19ca2777b9a419136270e5c4390f1149
2017-02-03 16:45:38 -08:00
Colin Cross
068e0feace Support filegroups
filegroup is a module that contains a list of files, and can be used
to export files across package boundaries.  filegroups (and genrules)
can be referenced from srcs properties of other modules using the
syntax ":module".

Test: m -j
Change-Id: I3d6fc4819c0b4225b474e0ad42f0d947f55a5961
2016-12-17 16:34:03 +00:00
Colin Cross
37047f1c7e Pass DepsContext to dependency methods
Pass a DepsContext that embeds android.BottomUpMutatorContext
instead of android.BaseContext so that dependency methods can
directly add dependencies.

Test: m -j
Change-Id: Id4c157975d3d6f03efd99785d217bef486a76139
2016-12-13 17:32:29 -08:00
Dan Willemsen
e1240db6ab Support aidl cpp generation
Ideally we'd calculate the headers that are written here too, but I'll
add that in a later change that actually enforces the generated header
list.

Test: mmma -j system/tools/aidl
Change-Id: Ifd2e8e8ff444b0f67270fb5156e7bf7bceddb6be
2016-12-05 15:49:40 -08:00
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