Commit Graph

867 Commits

Author SHA1 Message Date
Saleem Abdulrasool
a1357c1bed build: remove unnecessary variable (NFC)
The `platform` variable already contains the SDK name, no need to create
a new variable for that.
2019-12-27 15:36:18 -08:00
Alex Langford
a6fd37e128 [build] Remove make_relative_symlink from build-script-impl
Nothing uses this anymore, remove it.
2019-12-18 14:31:54 -08:00
Eric Miotto
f67ccf5c9d Unset IFS after its use in set_build_options_for_host (#28811)
If IFS remains set, it may cause compilation errors due to unanticipated
replacement of characters in some parameters.

Addresses rdar://problem/57927748
2019-12-17 07:43:58 -08:00
Alex Langford
81e3c76c1d [build] Simplify setting SWIFT_HOST_VARIANT and related variables
In the majority of cases, we can derive the value of SWIFT_HOST_VARIANT,
SWIFT_HOST_VARIANT_SDK, and SWIFT_HOST_VARIANT_ARCH from the value of `host`
itself. The goal of this patch is to make those derivations and avoid lots of
manual setting of values. Because we verify that we have a valid host before
doing this, we can be sure that errors should be caught before we try to
deconstruct the host into platform and architecture values.

For situations where you can't derive those values from the host, we leave
existing behavior -- that is, we handle them in a switch statement.
2019-12-12 11:33:34 -08:00
Alex Langford
24d191d1e6 [build] Verify a host is supported when setting build options
By verifying that the host is supported before doing any operations, we can
assume that the host value is properly formed, meaning we can simplify the logic
to set values based on the host. Follow-up commits will do exactly that.
2019-12-12 11:32:00 -08:00
Saleem Abdulrasool
3a24f59d15 Merge pull request #28667 from xiaobai/leaving-my-cmark
[build] Reduce redundancy in setting cmark cmake options
2019-12-11 14:26:40 -08:00
Vedant Kumar
59fe43a7c5 Revert "[build-script] Do not specify LLDB_FRAMEWORK_INSTALL_PATH (#28418)" (#28675)
This reverts commit 486e2e76ba.
2019-12-10 11:46:03 -07:00
Alex Langford
3d50fa829c [build] Reduce redundancy in setting cmark cmake options 2019-12-09 16:16:26 -08:00
Butta
14cc620016 [android] A few tweaks for native compilation and to get more tests working
Now that CMAKE_HOST_SYSTEM_NAME and CMAKE_SYSTEM_NAME are set by default to
Android in the Termux app, make the needed tweaks. Some tests were adapted
to work natively on Android too, adds sys/cdefs.h to the Bionic modulemap,
and includes the start of native Android platform support in the build-script.
2019-12-07 01:01:59 +05:30
Robert Widmann
e6cfd51e3d Merge pull request #28537 from edymtt/skip-clang-tools-extra
[build] allow to skip build of clang-tools-extras
2019-12-03 18:44:22 -08:00
Eric Miotto
ee99bf1f57 [build] prefer picking up sqlite3 from Darwin SDK for llbuild (#28440)
* [build] prefer picking up sqlite3 from Darwin SDK for llbuild

When building llbuild on Darwin platforms, ensure that we prefer the SQLite from the SDK
instead of picking one found elsewhere (e.g. in /usr/include )
Also consider only the SQLite dylib shipped with the OS.

Addresses rdar://problem/57300418
2019-12-03 12:55:17 -08:00
Eric Miotto
f19f97839f [build] allow to skip build of clang-tools-extras
Also at the same time refactor code that composes LLVM_ENABLE_PROJECTS

Supports rdar://problem/57432088
2019-12-03 09:50:14 -08:00
Alexander Sokol
4c8f91db98 [build] SR-11880 skip building compiler-rt with --xcode 2019-12-01 21:32:06 +03:00
Vedant Kumar
486e2e76ba [build-script] Do not specify LLDB_FRAMEWORK_INSTALL_PATH (#28418)
This should be provided by the appropriate lldb cmake cache.
2019-11-21 13:12:52 -08:00
Alex Langford
ac4ac89ece [build] Remove build-script-impl logic to set up project symlinks
Instead of manually setting up symlinks in the project, it would be easier and
cleaner to use LLVM_ENABLE_PROJECT.
2019-11-18 16:10:05 -08:00
swift-ci
4bf1059f52 Merge pull request #28293 from spevans/pr_static_foundation 2019-11-17 01:57:44 -08:00
Saleem Abdulrasool
3932133649 Merge pull request #26495 from porglezomp-misc/build-script-remove-redundancy
Remove build-script-impl target calculation
2019-11-16 14:16:00 -08:00
Alex Langford
2978884fc0 [build] Refer to projects through the monorepo directly
Why am I doing this?
Because we have now switched to the monorepo, we no longer need to have logic to
detect whether or not a project is present. Any project under the llvm project
is guaranteed to be available if you're building llvm.

I hope this is the first change of many that can clean up some of the logic in
build-script-impl. Some simplifications and cleanups that I think can be made
include:
- Adding the option to build swift as a part of the llvm build. (Or even making
  this the default behavior)
- Taking advantage of `LLVM_ENABLE_PROJECTS` to simplify some of the logic to
  set up clang, clang-tools-extra, and other projects.
2019-11-15 15:30:06 -08:00
Simon Evans
da6991537f [Linux] Build and install Foundation static libraries.
- Builds libFoundation.a, libFoundationNetworking.a and
  libFoundationXML.a and installs them in usr/lib/swift_static/linux

- Note this does NOT make -static-stdlib work for Foundation at this time.
2019-11-15 22:16:31 +00:00
Saleem Abdulrasool
6ff321aa5f build: adjust cmake invocation for export targets
This adjusts the cmake invocation for Foundation to use the export
targets rather than computing the locations by hand.
2019-11-13 10:25:58 -08:00
Saleem Abdulrasool
5b38c1efb4 build: adjust flags to XCTest cmake invocation
Update the cmake invocation for XCTest to enable switching to a newer
CMake version.
2019-11-12 18:42:16 -08:00
Saleem Abdulrasool
0ad2e24dde build: adjust cmake invocation for llbuild 2019-11-08 07:53:41 -08:00
Vedant Kumar
cb25560490 [build-script] Allow lipo of cross-compiled lldb products (#27920)
Teach build-script to build lldb's `install-distribution` target when
installation is required, and make the lipo action invoke lipo when
cross-compiling.

Incidentally this fixes a bash warning about `continue` being invalid
outside of a loop.
2019-11-05 12:45:05 -08:00
Saleem Abdulrasool
cda6942121 build: enable *building* lld
This enables building lld to ensure that we are able to build it in our
toolchain.  This does not change the linker used for any of the builds.
2019-11-04 09:30:25 -08:00
Ankit Aggarwal
7241030876 Move swiftpm to swift_build_support infra
This will allow cleaning up most of the hacks in SwiftPM's build script.

<rdar://problem/56220087>
2019-11-03 03:23:35 +00:00
Alex Hoppen
fcd3457560 [build-script] Migrate SwiftSyntax to swift_build_support 2019-10-29 10:40:09 -07:00
Alex Hoppen
776e2c0030 Revert "Migrate building SwiftSyntax to swift_build_support" 2019-10-29 09:55:32 -07:00
Alex Hoppen
282d0de82f Merge pull request #27871 from ahoppen/swiftsyntax_build_support
Migrate building SwiftSyntax to swift_build_support
2019-10-29 08:45:41 -07:00
Vedant Kumar
b92beb46ef [build-script] Teach cross-compile hosts check about --skip-local-build (#27911)
Check whether there are any cross compile hosts by looking at the
CROSS_COMPILE_HOSTS array, not at ALL_HOSTS, as these can be different
due to --skip-local-build.
2019-10-28 14:39:48 -07:00
Vedant Kumar
2a05418dac [build-script] Forward cross-compile host flags to lldb (#27910) 2019-10-28 14:37:02 -07:00
Alex Hoppen
7ed085cb55 [build-script] Migrate SwiftSyntax to swift_build_support 2019-10-25 15:58:07 -07:00
Alex Hoppen
d5c28d870e Merge pull request #27841 from ahoppen/forward-verify-generated-files
SwiftSyntax: Commit gyb-generated files to master
2019-10-25 11:34:20 -07:00
Jonas Devlieghere
40e5924f60 Merge pull request #27814 from JDevlieghere/use-static-bindings
[CMake] Fix the static bindings workflow.
2019-10-24 09:20:19 -07:00
Saleem Abdulrasool
3c17e976b3 build: adjust rpath for new foundation layout
This adjusts the encoded RPATH to enable us to switch to the new
Foundation build.
2019-10-23 13:53:14 -07:00
Alex Hoppen
58d3c86b1d [build-script] Add flag that forwards to SwiftSytnax --verify-generated-files
This will allow us to set up a CI bot that can test that all generated
sources in SwiftSyntax are up-to-date.
2019-10-22 14:31:21 -07:00
Jonas Devlieghere
ec21125988 [CMake] Fix the static bindings workflow.
Rename LLDB_ALLOW_STATIC_BINDINGS to LLDB_USE_STATIC_BINDINGS and make
LLDB use the static bindings unconditionally when it's set. The current
variable is opaque because it allows LLDB to use the static bindings,
but only if SWIG is not found. If an incompatible version of swig is
found, it reports a fatal error. This serves no purpose other than to
confuse the user.

The corresponding LLDB patch simplifies things and makes the variable do
what you expect. When enabled, LLDB uses the static bindings. When
disabled, we try to generate them with SWIG.

This patch modifies the build scripts to pass the new variable.
2019-10-21 14:39:25 -07:00
Alex Hoppen
1926da3fe7 [build-script] Move building swiftevolve to swift_build_support 2019-10-19 19:10:41 -07:00
Alex Hoppen
adbd96bcf1 [build-script] Move building skstresstester to swift_build_support 2019-10-19 19:10:41 -07:00
Jonas Devlieghere
2f95cf0236 [build-script] Fix typo in variable name.
s/LLVM_LIT_ARG/LLVM_LIT_ARGS/
2019-10-14 15:50:30 -07:00
Saleem Abdulrasool
ec32e9a3cd build: tweak LLDB flags for testing
Adjust LLDB flags for new Foundation layout.
2019-10-13 19:20:02 -07:00
Saleem Abdulrasool
23db8d0e2e build: pass CMAKE_Swift_COMPILER to llbuild
Setup the CMake invocation for the migration to CMake 3.15.  This will
allow us to simplify the s-p-m bootstrap and the llbuild build itself
(see apple/llbuild#587).
2019-10-13 15:22:47 -07:00
Adrian Prantl
95e73433ef Only pass -DLLVM_USE_SPLIT_DWARF in DebugInfo-enable builds.
Thanks to Daniel Rodríguez Troitiño for pointing this out!
2019-10-11 10:33:06 -07:00
adrian-prantl
eb02f20f99 Merge pull request #27407 from adrian-prantl/split-dwarf
On Linux build LLVM and subprojects with -gsplit-dwarf which is more …
2019-10-10 10:28:25 -07:00
Alex Hoppen
1d7d58a363 Merge pull request #27576 from ahoppen/install-swiftsyntax-module
[build-script] Fix issue with installing SwiftSyntax if target dir does not exist
2019-10-08 15:54:30 -07:00
swift-ci
f692420e31 Merge pull request #27567 from dcci/skip-local-build 2019-10-08 13:21:24 -07:00
swift-ci
f2b43e4bf0 Merge pull request #27575 from mikeash/compiler-retweet-nonexistent-ls 2019-10-08 13:15:33 -07:00
Alex Hoppen
36a7e93290 [build-script] Fix issue with installing SwiftSyntax if target dir does not exist 2019-10-08 11:48:52 -07:00
Ross Bayer
e40a6fd42d [Build System: build-script-impl] Fix the copy logic in build-script-impl to install the compiler-rt builtins to only 'ls' directories that exist. 2019-10-08 14:47:54 -04:00
Alex Hoppen
f2229c4811 Merge pull request #27566 from ahoppen/install-swiftsyntax-module
[build-script] Pass updated arguments to SwiftSyntax's build script
2019-10-08 11:26:10 -07:00
Davide Italiano
b2a1e1c1ff [build-script] Introduce an option to skip local build.
This is useful for cross-compiling.

<rdar://problem/55916729>
2019-10-08 11:16:08 -07:00