Commit Graph

1731 Commits

Author SHA1 Message Date
Ben Langmuir
cba2670479 [cmake] Update OPTIONAL install products to be Darwin-only
Per review feedback.
2019-01-22 12:05:55 -08:00
Ben Langmuir
d08a2a058a [cmake] Make install of stdlib target libraries OPTIONAL
This fixes using --install-swift on macOS when not building all of the
variant stdlibs (e.g. iphonesimulator, etc.).

When we build swift on macOS, by default we build only the macOS stdlib.
The other stdlib variants are still configured and there are targets to
build them if you e.g. run `ninja swift-stdlib-iphonesimulator-x86_64`
manually.  However, we do not separate the _install_ actions.  This
meant that you couldn't install without building all the configured
stdlib variants.
2019-01-22 11:13:29 -08:00
Maya Rashish
bc236c9a37 Fix typo regarding supported FreeBSD architectures 2019-01-21 17:25:34 +02:00
Saleem Abdulrasool
d4598ec15a Merge pull request #22002 from compnerd/nx
build: inline single use `add_swift_executable`
2019-01-19 13:22:40 -08:00
Saleem Abdulrasool
7402221425 build: cleanup unneeded flags for Windows
This flag is now handled by the driver, so remove it from the special
handling in the build system.
2019-01-19 10:06:06 -08:00
Saleem Abdulrasool
a0ec0c0dfb build: inline single use add_swift_executable
Inline the single use of this function and remove the extra parameter
handling around it, letting `_add_swift_executable_single` do the heavy
lifting.
2019-01-19 09:38:40 -08:00
Harlan Haskins
3300762ce4 [CMake] Set SWIFT_ENABLE_PARSEABLE_MODULE_INTERFACES for standalone overlays
This should be true when building standalone overlays as well.
2019-01-17 15:48:52 -08:00
Jordan Rose
bb6c6435d4 [CMake] Include apinotes in StandaloneOverlay.cmake (#21928)
...because the Darwin overlay is responsible for installing them.

Context: Within Apple, overlays are sometimes built separately from
the rest of the Swift project. This doesn't currently work with just
the public repo (rdar://problem/47324189), but it could, and I broke
it with my recent API notes cleanup. This should get things working
again.

rdar://problem/47294352
2019-01-17 10:34:18 -08:00
Ben Langmuir
d685728d4a Merge pull request #21886 from benlangmuir/install-components-default
Set a reasonable default for SWIFT_INSTALL_COMPONENTS
2019-01-17 10:12:44 -08:00
Ben Langmuir
aac60468a2 Set a reasonable default for SWIFT_INSTALL_COMPONENTS
Previously, build-script-impl would set this to "" by default, resulting
in nothing being installed with --install-swift unless you explicitly
set --swift-install-components as well.  Now we defer to cmake by
default.

On the cmake side, change the default value to exclude
* dev - uses a lot of disk space and usually not something you want to
  install into a toolchain
* clang-resource-dir-symlink & clang-builtin-headers-in-clang-resource-dir -
  these are mutually exclusive with clang-builtin-headers
* sourcekit inproc/xpc - these are currently mutually exclusive, so pick
  the best one for the current platform.
2019-01-16 14:48:02 -08:00
Doug Gregor
00485afc68 Always set the compatibility_version of linked dylibs on Darwin.
Use 1.0.0 when there is no more-specific SWIFT_COMPILER_VERSION.
2019-01-15 14:35:21 -08:00
Michael Gottesman
cb41b77dca Fix --force-optimized-typechecker
I believe this was broken due to recent refactoring of cmake.
2019-01-14 14:27:51 -08:00
Argyrios Kyrtzidis
9c0403761d Merge pull request #21762 from akyrtzi/syntax-parser-clib
Introduce C parser library
2019-01-11 11:19:50 -08:00
Argyrios Kyrtzidis
39019f2292 [CMake] Add 'parser-lib' install component and install the relevant files
The files go into 'lib/swift' so that SwiftSyntax can import the library without needing custom search paths to be added to the swiftpm invocation.
2019-01-10 09:10:11 -08:00
Jordan Rose
aea1ef8175 Move API notes out of the arch-specific subdirectories in lib/swift/ (#21690)
They're all the same anyway, and no longer even need to be compiled,
just copied in as text.

And drastically simplify how we "generate" them. Instead of attaching
their build jobs to the appropriate overlays, if present, "just" have
one job to copy them all and attach it to the Darwin overlay. That's
what we do for the overlay shim headers, and it's good enough.
(Eventually we want to get out of the business of shipping them
altogether.)

This does have the same flaw as the shim headers: if you /just/ change
API notes, the corresponding overlay does not get rebuilt. You have to
touch that too. But in practice that'll happen most of the time
anyway.

Part of rdar://problem/43545560
2019-01-09 14:06:21 -08:00
Saleem Abdulrasool
6dac8dd092 build: cleanup swiftCore link definition
Colocate the target specific library specification.  Inline the single
site use of the place holder ICU_UC and ICU_I18N libraries rather than
trying to create special library processing code for that.
2019-01-08 08:31:35 -08:00
Saleem Abdulrasool
46ec2cf0fb add_swift_host_tool: normalize arguments, rename prefix 2019-01-04 15:30:09 -08:00
Saleem Abdulrasool
783e8eceaa Merge pull request #21635 from compnerd/toolchain-only
build: honour LLVM_INSTALL_TOOLCHAIN_ONLY
2019-01-04 10:11:01 -08:00
Saleem Abdulrasool
29e8127d26 build: use the architecture directory for Windows resources
Windows does not support fat binaries, so the target specific components should
be placed into the architecture subdirectory.  Due to the cross-compilation
model that swift has, this needs to be added explicitly for now.
2019-01-04 09:08:35 -08:00
Saleem Abdulrasool
c9c12feacc build: honour LLVM_INSTALL_TOOLCHAIN_ONLY
This improves the integration with LLVM and the unified build.  The
LLVM_INSTALL_TOOLCHAIN_ONLY flag ensures that the the development libraries are
not installed.  Because this option is not defined by default, the beahavioural
changes here are not triggered by default.
2019-01-04 08:56:04 -08:00
Saleem Abdulrasool
1d2a4d65b5 build: attempt to install the import libraries 2019-01-03 12:24:20 -08:00
Saleem Abdulrasool
509060c78a build: convert paths to CMake paths before use
This converts the path separators to the CMake way.  This is primarily
important for Windows where the path separator is \ rather than /.  This
conversion allows the specification of the path in the proper windows
path style.
2018-12-30 12:27:16 -08:00
Saleem Abdulrasool
9624932391 build: add Windows includes to build 2018-12-16 22:23:41 -08:00
swift-ci
8629cd5c2a Merge pull request #21314 from drodriguez/android-link-with-cpp-abi 2018-12-15 14:31:08 -08:00
swift-ci
b2052b8498 Merge pull request #21329 from lanza/cache-vcvars 2018-12-15 13:59:00 -08:00
Saleem Abdulrasool
7020740dcf Merge pull request #21326 from xiaobai/swift_component_required
[CMake] Require SWIFT_COMPONENT for add_swift_host_tool
2018-12-14 17:30:47 -08: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
3225e36d63 stdlib: reorder add_subdirectory to repair the Windows build
Due to the horrible attrocities against software of the attempt to perform
cross-compilation in the swift build system, we need to emulate the linking
behaviour for Windows with the link against the import library.  The emulation
requires the custom creation of import library targets.  In order to actually
get the linking semantics correct, the dependendency targets must be created
prior to use (unlike standard CMake).  The reordering ensures that we get
correct linkage when building for Windows.

Perform a simple optimization to avoid a number of string comparisions for the
host system.
2018-12-14 13:56:16 -08:00
Greg Parker
41f048410a [build] Fix generated header files in standalone overlay builds. (#21206) 2018-12-14 13:28:53 -08:00
Daniel Rodríguez Troitiño
bcf800a15d [android] Link with static C++ ABI for Android.
Normally, the C++ shared library would have link against the C++ ABI
shared library, but the Android NDK does not distribute the later, so
one need to link manually against the static C++ ABI from the NDK.
2018-12-14 13:23:31 -08:00
Alex Langford
5d5d01a2fe [CMake] Require SWIFT_COMPONENT for add_swift_host_tool 2018-12-14 12:27:53 -08:00
Saleem Abdulrasool
883966edda build: only add -Fsystem path if configured
The system framework paths are only configured for the Apple targets.  Add a
condition to avoid a search path to be added for other SDKs.
2018-12-13 09:42:04 -08:00
Michael Gottesman
b2ae3a8b2c [cmake] Move add_swift_target_executable into the new stdlib cmake directory.
This will ensure that additional target executables can not be added to the rest
of the swift project without anyone noticing since the non-stdlib parts of
Swift's cmake will not have visibility of the declaration unless they change the
cmake lookup paths.
2018-12-11 16:43:49 -08:00
Saleem Abdulrasool
522f97da43 build: simplify the blocks handling
`-fblocks` is a core driver option now, so it can be used with both the GCC
style driver as well as the cl style driver.  Simplify the logic for the
handling of this option.
2018-12-07 08:24:19 -08:00
Saleem Abdulrasool
0a601defd5 build: use the right extension for Windows for swiftrt
The swift image registrar uses the extension `.obj` as is traditional on
Windows.  Ensure that we get the extension correct when cross-compiling with the
Swift specific cross-compilation system.
2018-12-06 15:51:35 -08:00
Daniel Rodríguez Troitiño
b3b0d87055 [android] Avoid linking twice with C++
The Android targetted libraries already link (manually) with the Android
NDK C++ libraries. When using Clang and lld, an extra link to libc++ is
requested, which will fail because Android names it libc++_shared.so
instead. To avoid looking for the wrong name, and since the library is
referenced manually either way, request no linking with the standard C++
libraries (but add the math library in, which is implicitly linked when
C++ is linked, and it is needed for Glibc at least).
2018-12-06 11:10:22 -08:00
Argyrios Kyrtzidis
9694851c23 Merge pull request #21075 from akyrtzi/syntax-parser-cmake-prep
[CMake] Move cross-platform dispatch/blocks support to the tools level, in preparation for the syntax parser library
2018-12-06 09:35:52 -08:00
Argyrios Kyrtzidis
92377cc145 [CMake] Move cross-platform dispatch/blocks support to the tools level, in preparation for the syntax parser library 2018-12-05 22:41:39 -08:00
Saleem Abdulrasool
e3b699bb59 build: overwrite the fat libraries with the targets
Ensure that the use the target specific names for the fat libraries for
non-MachO targets which do not support fat libraries.  This fixes the
windows build.
2018-12-03 19:39:50 -08:00
swift-ci
1c703bfc94 Merge pull request #20902 from compnerd/windows-modules 2018-11-29 22:16:04 -08:00
Saleem Abdulrasool
3d1839a016 build: support SWIFT_MODULE_DEPENDS_WINDOWS
Add support for depending on swift modules for the windows target.  This
is needed as the private swift modules start to build on Windows.
2018-11-29 19:26:59 -08:00
Saleem Abdulrasool
16a4af0e5b build: assume a parallel tree layout for unified builds
Attempt to repair the build for the unified swift build.  This allows us
to build a single unified toolchain with swift support.  In this layout
assume that cmark and clang are peers of LLVM rather than located in
`tools`.  Doing so allows a uniform layout of the tree and a simpler
build approach.
2018-11-29 12:26:02 -08:00
Michael Gottesman
f0fb3cf70f [gardening] Invert an if condition to reduce indentation. 2018-11-28 23:18:27 -08:00
Daniel Rodríguez Troitiño
def11722a9 Split link flags and link libraries lists to make gold happy.
gold is more strict than lld about the order of the arguments, that's
why CMake offers two different properties for the linker: LINK_FLAGS and
LINK_LIBRARIES. The former _add_variant_link_flags was adding the
libraries to LINK_FLAGS, when the correct thing is to add them to
LINK_LIBRARIES.

The change adds a new output variable for _add_variant_link_flags which
will containt the linked libraries, and CMake will be able to generate
the correct command line invocation for when gold is used.

This should fix the Android CI build.
2018-11-27 15:24:52 -08:00
Jordan Rose
db7529fa5c Merge pull request #20784 from jrose-apple/generated-nine-out-of-ten
[CMake] Conditionalize generation of .swiftinterface files
2018-11-27 09:09:55 -08:00
Saleem Abdulrasool
d1eb3a54b4 Merge pull request #20766 from compnerd/importing-fat
build; correct swift fat library linking on Windows
2018-11-26 21:36:31 -08:00
Jordan Rose
605c9f619f [CMake] Conditionalize generation of .swiftinterface files
SWIFT_ENABLE_PARSEABLE_MODULE_INTERFACES is the new setting.

rdar://problem/44942414
2018-11-26 17:04:46 -08:00
Saleem Abdulrasool
d8bce85076 build; correct swift fat library linking on Windows
Windows does not link against the library but the import library.  When
building the target specific bits, we unfortunately do not use the cmake
build infrastructure properly.  This results in us trying to link
against libraries which do not exist.  Redirect the link to the right
files.  This allows us to build swift-reflection-test.
2018-11-26 16:38:38 -08:00
Saleem Abdulrasool
6a0989b7a2 build: pass /GR- when using cl-like drivers
When building with clang-cl, we should pass /GR- rather than the
gcc-style driver options.  This repairs the build of swift on Windows.
2018-11-26 12:50:18 -08:00
Saleem Abdulrasool
66fa742732 Merge pull request #20718 from compnerd/host-tools-dce
host tools DCE
2018-11-26 09:55:17 -08:00