Commit Graph

50 Commits

Author SHA1 Message Date
Maya Rashish
bc236c9a37 Fix typo regarding supported FreeBSD architectures 2019-01-21 17:25:34 +02:00
Nathan Lanza
c442763219 Cache VCVARS variables for incremental building on Windows
The initial configure & generate of a build on Windows should have
the necessary VCVARS set in the environment. After that, we should be
incrementally building with those same vars to avoid conflicts between
Windows SDKs.

Cache these vars so that the same Windows SDKs are consistently used
in future incremental builds.
2018-12-14 15:06:28 -08:00
Saleem Abdulrasool
a5d360ba7a build: do not create WinSDK symlinks when unneeded
When building on case insensitive filesystems, there is no need to
create the library symlink forest as the paths will be resolved properly
due to the insensitivity.  This avoids a bit of work and spew on
Windows.
2018-11-05 16:16:08 -08:00
Saleem Abdulrasool
f0beaf2c6f Merge pull request #19861 from compnerd/symlinks
build: workaround incorrectly cased import libraries in WinSDK
2018-10-13 09:10:57 -07:00
Saleem Abdulrasool
dae761fbd5 build: workaround incorrectly cased import libraries in WinSDK
The Windows SDK proides kernel32.Lib which on case sensitive file systems will
fail (due to the capital L in the extension).  Workaround that by creating
symbolic links to handle this.  This mirrors the technique used in LLVM.
2018-10-12 14:44:34 -07:00
Daniel Rodríguez Troitiño
8fb8b39e9f Remove unused variables from Android configuration 2018-10-09 17:15:47 -07:00
Saleem Abdulrasool
b76af893ec build: fix the variable name
The parameter name was not changed, resulting in the string conversion
not working properly for the Windows builds.
2018-10-08 15:53:13 -07:00
Saleem Abdulrasool
8c0fa0e13a build: prevent printing for unused variables for SDK
Reduce some of the SDK configuration printing for non-Darwin
configurations.  This simplifies the output and SDK configuration.  The
parameter reduction simplifies the setup for cross-compilation.
2018-10-08 09:52:29 -07:00
Saleem Abdulrasool
392082fec6 build: remove unneeded variables for non-Darwin SDKs
This alters the SDK configuration to remove the variables that don't
impact the target configuration.  Simply don't define them.
2018-10-08 09:52:29 -07:00
Saleem Abdulrasool
4880b94dfd build: remove sdk parameters which can be computed
The prefix and platform names are case adjusted values of the name of
the SDK.  Compute the value rather than pass them down.  The
simplifications will yield an easier cross-compilation implementation.
2018-10-08 09:52:29 -07:00
Saleem Abdulrasool
5054a22d0b build: hard code the triple into the SDK configuration
Rather than computing the triple first and passing it down to the SDK
configuration, hard code the triple into the SDK's configuration.  This
is a value which is static and will allow us to configure
cross-compilation of the standard library for Linux.  Although most
other targets do not support the same variety of architectures, this
enables those to be cross-compiled as well.
2018-10-08 09:52:29 -07:00
Saleem Abdulrasool
f02cd8f6f1 build: remove unnecessary parameter to configure_sdk_unix
Remove the duplicated platform name parameter to the unix SDK
configuration..  This value is implicit currently and can be computed.
This needs to be computed to permit parallel co-installations of
architectures for targets which do not support fat binaries (i.e.
non-MachO targets).
2018-10-08 09:52:29 -07:00
Saleem Abdulrasool
f0885be6a0 build: allow specifying the Linux SDK path
The SDK is a sysroot.  Permit the user to specify the location of the
SDK when building Linux.  This is in preparation to cross-compile the
Linux standard library.

While we are exposing more control knobs to the user, we can start
simplifying `configure_sdk_unix`.
2018-10-08 09:52:29 -07:00
Saleem Abdulrasool
583ceaede5 build: support android aarch64
This adds the needed support to enable building the standard library for android
aarch64 assuming that the appropriate parameters are passed to CMake.
2018-09-24 09:55:10 -07:00
Saleem Abdulrasool
0494ab651e build: hardcode the android triple in the SDK configuration
The SDK configuration can identify the triple for the android targets.  This is
similar to the Windows behaviour.  Doing so will now enable multi-architecture
builds!
2018-09-24 09:54:54 -07:00
Saleem Abdulrasool
30a4853177 build: remove SWIFT_ANDROID_SDK_PATH
The path to the SDK can be computed from the NDK.  Do so to reduce the
parameters needed to pass to CMake.  More importantly, this will allow building
with multiple architectures simultaneously.
2018-09-24 09:54:45 -07:00
Saleem Abdulrasool
777bd91a15 build: rename a variable to be more descriptive (NFC)
This variable is the build host, not a suffix.  Name it appropriately.  NFC.
2018-09-24 09:54:38 -07:00
Saleem Abdulrasool
5e04c26896 build: inline android specific configuration
The android specific configuration here is the same as the non-android in the
sense that it is setting up the triples for the target.  Simply inline it as it
makes it more obvious what it is doing.  This is preparatory work for adding
support for multiple architectures for Android.
2018-09-24 09:54:26 -07:00
Nathan Lanza
7429856034 Change various search and linker paths to account for changes in NDK16
ndk14 introduced "unified headers" which merged the headers for all
different API versions into one directory which effectively split the
"SWIFT_SDK_ANDROID_ARCH_${ARCH}_PATH" into two different directories.

Add include and library specific paths to various compilation and link
invocations across the Swift project to account for this change. Remove
some broken sysroot/sdk specific settings.
2018-05-02 14:18:11 -07:00
Saleem Abdulrasool
61d979348f build: report the ICU path used for the target
Report the ICU I18N and UC include paths and the library path.  This
makes it obvious when the variable is not defined and more importantly
makes it easier to see what the paths are being used particularly when
cross-compiling for multiple architectures.
2018-04-25 21:23:51 -07:00
Thomas Roughton
823bb0a530 Check for CMAKE_BUILD_TYPE_DEBUG instead of RELEASE
… since MinSizeRel and RelWithDebugInfo are also configurations.
2018-04-18 19:13:47 +12:00
Nathan Lanza
c3fe715c28 Change the arch argument for configure_sdk_unix to architectures (#15756)
General purpose cross compilation from host x to targets a,b,c will
require the ability to have multiple architectures passed to
`configure_sdk_unix`. Simply change the function to accept multiple
archs.
2018-04-09 19:43:19 -07:00
Saleem Abdulrasool
19aeb69cfb build: indicate VC++ CRT type for Windows builds
Indicate whether the debug or release CRT is in use when building for
Windows.
2018-04-06 13:09:41 -07:00
Nathan Lanza
e06c52584f Change various uses of SWIFT_SDK_${SDK}_PATH to its architecture specific vairant
Cross-compilation for multiple architectures & sdks require various
variables to be split to specify the arch/adk variant being focused on.
This change modifies various uses of the `SWIFT_SDK_${SDK}_PATH` to
`SWIFT_SDK_${SDK}_ARCH_${ARCH}`
2018-03-30 17:50:59 +00:00
Nathan Lanza
dd3cbf0b64 Add architecture specific path variables to SwiftConfigureSDK
New variables are introduced to track the path for the architecture
specific subdirectories

This work is mostly attributed to Zach Bowling
2018-03-20 16:20:43 -07:00
Bob Wilson
15ac679694 master-next: fix PR13574 for Linux
Set the deployment target to an empty string for non-Darwin platforms
so that it is safe to append to the target triple without guarding it
with a check for Darwin.
2017-12-21 08:33:18 -08:00
Bob Wilson
b7981aa6ea master-next: Set the deployment version correctly in -target options.
This change leaves in place the use of -m*-version-min options, but
fixes the -target options to match. We can eventually remove the use of
the -m*-version-min options after everyone has moved to build with
versions of Clang that correctly handle the deployment version in the
-target option.
2017-12-20 23:15:44 -08:00
Saleem Abdulrasool
2f9f585b57 build: special case Windows ARM target
Windows ARM NT (the modern, non-Windows CE environment) is a pure thumb2
environment.  The frontend does not canonicalise the target like in
clang.  Ensure that we map the triple by hand to the desired target
triple.
2017-10-15 12:10:58 -07:00
Saleem Abdulrasool
27d051a6c3 build: improve the Windows build infrastructure
Rather than use the `INCLUDE` and `LIB` environment variables to build
the Windows code, use the `UniversalCRTSdkDir`, `UCRTVersion`, and
`VCToolsInstallDir` variables.  Using these we can compute the right set
of include directories and library search paths for the various
architectures.  This will enable us to build multiple variants of the
Windows stdlib at the same time.

Additionally, rather than relying on the magic environment variables to
be processed by the driver, pass them explicitly to the driver through
the build system.  This also is needed to allow parallel builds of
various architecture variants of the stdlib on Windows.
2017-09-23 16:08:42 -07:00
Gonzalo Larralde
443e7614e4 Fixes on linker executable variables per target.
* `prefix` should be `sdk` in runtime cmake list file
* typo on variable existence checking
2017-03-07 10:00:58 -03:00
Saleem Abdulrasool
125e882c8c build: permit overriding the linker
When cross-compiling for android ARM, it is possible that the system
linker does not support the target.  However, in order to cross-compile
the target runtime, we need to adjust the linker to the target linker.
If one is not specified, fall back to the current behaviour of using the
system linker.
2017-02-26 11:25:07 -08:00
Hugh Bellamy
e201d93485 Add support for Windows in the root CMakeLists.txt file 2016-12-28 14:46:18 +00:00
Saleem Abdulrasool
5e170ebcb5 build: support cross-compiling to windows 2016-07-13 21:37:04 -07:00
Saleem Abdulrasool
b1978d5144 build: track object format with SDK 2016-06-22 09:37:56 -07:00
SpringsUp
8c7da8d082 Refactored host/target SDK detection to support cross-compiling 2016-05-18 07:24:47 +02:00
David Farler
d9bbb6caf0 Remove checks and references to internal Apple SDKs.
These aren't available for use outside of Apple.

rdar://problem/23302539
2015-11-16 16:07:55 -08:00
Dmitri Hrybenko
c1678ff361 CMake: DARWIN_USE_INTERNAL_SDK: Actually use the internal SDK
Swift SVN r32361
2015-10-01 03:21:54 +00:00
Dmitri Hrybenko
e475fa0ae2 CMake: when looking for an internal SDK, check for the 'PrivateFrameworks' dir
Swift SVN r32333
2015-09-30 01:50:38 +00:00
Dmitri Hrybenko
26e5be03b7 CMake: add an option that forces the use of internal SDK
rdar://22866512

Swift SVN r32316
2015-09-29 22:59:00 +00:00
Sonny Falk
a24c051e52 CMake: Cross compiling requires internal SDK.
Refactor configure_sdk_darwin(), remove the "internal" parameter since all calls are the same, make it respect SWIFT_USE_INTERNAL_SDK instead.

Make it use the internal SDK only if cross compiling tools, since it's required.

Swift SVN r31509
2015-08-26 22:43:01 +00:00
Arnold Schwaighofer
f6224bd3f0 Allow libraries to specify to be compiled against the internal variant of the SDKs
We will need this to switch the darwin targets over to use ICU instead of going
to NSString for string operations. The public SDK does not contain the headers
for ICU - only the dylib.

For builds using a public SDK users can specify the path to an ICU install where
the headers can be found. If this path is specified the logic will not use
internal SDK variants.

Swift SVN r31471
2015-08-26 02:55:45 +00:00
David Farler
9e4d52c9cb Reinstate watchOS and other SDK overlays to build against the public SDKs.
Un-revert the below commits with the following addition:
add declarations for posix_spawn related APIs to SwiftPrivateDarwinExtras.
posix_spawn-related APIs aren't available in the public SDKs, so force past
the availability by creating our own stubs in the internal DarwinExtras
library.

r31244, r31245

CMake: build all platforms except watchOS using the public SDK

Covers rdar://problem/21145996.
A step towards rdar://problem/21099318.

Switch SDK overlays to use the public SDK

I had to cut the dependency on CrashReporterClient.h and reimplement
some of that code inline in the Swift runtime.  This shoud be OK (even
though not very clean), since the layout of CrashReporter sections is
ABI.

rdar://21099318

Swift SVN r31252
2015-08-14 22:09:49 +00:00
Dmitri Hrybenko
c75fc00cec Revert "CMake: build all platforms except watchOS using the public SDK"
This reverts commit r31244.  It broke the buildbot.

Swift SVN r31247
2015-08-14 18:56:15 +00:00
Dmitri Hrybenko
dd38372fb7 CMake: build all platforms except watchOS using the public SDK
Covers rdar://problem/21145996.
A step towards rdar://problem/21099318.

Swift SVN r31244
2015-08-14 17:26:04 +00:00
Mish Awadah
10bdef0936 Revert "CMake: build all platforms except watchOS using the public SDK"
This reverts commit cd3f1ba7d1ee2397817e1a165209fdeab8a1c004.

Reverting this b/c it is breaking buildbots with the following:
CMake Error at CMakeLists.txt:522 (message):
  CrashReporterClient library is required, but it was not found

Swift SVN r31047
2015-08-06 06:12:23 +00:00
Dmitri Hrybenko
271acdfcab CMake: build all platforms except watchOS using the public SDK
Covers rdar://problem/21145996.
A step towards rdar://problem/21099318.

Swift SVN r31041
2015-08-06 04:28:05 +00:00
Greg Parker
039ebc97d2 [build] Fix typo in SWIFT_SDK_*_VERSION.
Swift SVN r26937
2015-04-03 08:02:08 +00:00
Greg Parker
b855ee64d8 [build] Print Xcode and SDK build numbers during configuration.
Swift SVN r26936
2015-04-03 08:01:13 +00:00
David Farler
544ef4002d Merge tvOS and watchOS Support
- Add frontend and standard library build support for tvOS.
- Add frontend support for watchOS.

watchOS standard library builds are still disabled during SDK bring-up.

To build for TVOS, specify --tvos to build-script.
To build for watchOS, specify --watchos to build-script (not yet supported).

This patch does not include turning on full tests for TVOS or watchOS, and
will be included in a follow-up patch.

Swift SVN r26278
2015-03-18 21:35:07 +00:00
Dmitri Hrybenko
6670bb76ec Rewrite the CMake build system
Swift SVN r24124
2014-12-23 22:15:30 +00:00