Commit Graph

1144 Commits

Author SHA1 Message Date
Saleem Abdulrasool
46cbfef03a Merge pull request #22258 from compnerd/integrating-variables
utils: attempt to replace custom variables
2019-02-22 13:22:51 -08:00
Saleem Abdulrasool
8062230cff CMake: use _WINDLL rather than _USRDLL
`_USRDLL` is used to indicate that you are building a MFC DLL while
`_WINDLL` is specified for **ALL** DLL builds.  Use the correct macro.
2019-02-22 10:49:25 -08:00
Jordan Rose
43feb9cbe1 On Apple platforms, use swiftmodule directories for the stdlib (#21797)
This changes the Swift resource directory from looking like

    lib/
      swift/
        macosx/
          libswiftCore.dylib
          libswiftDarwin.dylib
          x86_64/
            Swift.swiftmodule
            Swift.swiftdoc
            Darwin.swiftmodule
            Darwin.swiftdoc

to

    lib/
      swift/
        macosx/
          libswiftCore.dylib
          libswiftDarwin.dylib
          Swift.swiftmodule/
            x86_64.swiftmodule
            x86_64.swiftdoc
          Darwin.swiftmodule/
            x86_64.swiftmodule
            x86_64.swiftdoc

matching the layout we use for multi-architecture swiftmodules
everywhere else (particularly frameworks).

There's no change in this commit to how Linux swiftmodules are
packaged. There's been past interest in going the /opposite/ direction
for Linux, since there's not standard support for fat
(multi-architecture) .so libraries. Moving the .so search path /down/
to an architecture-specific directory on Linux would allow the same
resource directory to be used for both host-compiling and
cross-compiling.

rdar://problem/43545560
2019-02-19 14:47:21 -08:00
Saleem Abdulrasool
817597c7f9 utils: attempt to replace custom variables
CMake defaults to using a special <package>_DIR for finding packages.
Prefer this to import the CMake package for LLVM/Clang/Swift rather than
custom paths.
2019-02-14 20:19:08 -08:00
Saleem Abdulrasool
adbb7d7cbd build: simplify condition and IWYU CMake edition
Include a missing CMake module in a couple of locations that we were
using the function.  Simplify a condition to use `MATCHES` rather than
two `STREQUAL`.
2019-02-14 17:35:18 -08:00
Jordan Rose
bc35b34c64 [CMake] StandaloneOverlay: set components before including apinotes/ (#22592)
Otherwise, we'll think we don't need to install the API notes.

No test because this configuration isn't (yet) tested publicly
anywhere, but it is being tested within Apple.
2019-02-13 17:56:31 -08:00
Jordan Rose
4970946265 [CMake] Limit copy-legacy-layouts dependency to the stdlib (#22593)
When we do standalone overlay builds, they should rely on these
layouts already being in the toolchain. (In particular, the target
is never created.)

No tests because this configuration isn't (currently) being tested
outside of Apple.
2019-02-13 16:21:34 -08:00
Ross Bayer
083350af77 Revert "[CMake] Remove LINK_LIBRARIES option from _add_swift_executable_single" 2019-02-12 14:42:22 -08:00
Slava Pestov
c8effd26b3 Merge pull request #22408 from slavapestov/always-use-legacy-layouts
Always use legacy layouts
2019-02-11 19:10:02 -05:00
Ross Bayer
fc58ad4207 Merge pull request #22128 from xiaobai/remove_link_libs_option
[CMake] Remove LINK_LIBRARIES option from _add_swift_executable_single
2019-02-11 12:22:26 -08:00
Saleem Abdulrasool
f441f089cc build: fix mismatch of MSVCRT in release mode
When building RelWithDebInfo, we would accidentally link against the debug
MSVCRT library rather than the release mode one resulting in memory corruptions.
2019-02-08 15:08:56 -08:00
Slava Pestov
9f80a9cff0 Copy legacy layouts to stdlib build directory
This adds a new copy-legacy-layouts-${platform}-${arch} target for each
platform and architecture that the standard library is built for.

If the platform and architecture has a corresponding layout file in
stdlib/public/legacy_layouts/${platform}/layouts-${arch}.yaml, the
target copies this file to the build directory; otherwise, it does
nothing.

When building Swift code, the subroutines in SwiftSource.cmake add a
dependency on this target from each Swift code target.

Finally, we ensure that the YAML files are copied into the toolchain
package when building a toolchain.
2019-02-08 14:22:00 -05:00
fredriss
b6077176ee Merge pull request #21904 from compnerd/mirror-mirror-on-the-wall
SwiftRemoteMirror: add a host build for the tools
2019-02-04 14:56:42 -08:00
Ben Langmuir
c1744de648 Merge pull request #22193 from benlangmuir/crash-cmake-less
Re-apply "Set a reasonable default for SWIFT_INSTALL_COMPONENTS"
2019-01-29 09:31:01 -08:00
Saleem Abdulrasool
85f45dfe30 SwiftRemoteMirror: add a host build for the tools
This adds an explicit version of the SwiftRemoteMirror library for use
in the tools that comprise the toolchain.  This is a separate build from
the target specific builds of the library even though we may be building
the runtime for the (same) host.
2019-01-28 18:00:58 -08:00
Ben Langmuir
2d5fbb9f18 Re-apply "Set a reasonable default for SWIFT_INSTALL_COMPONENTS"
This reverts commit 77689f5945 (#22079)
2019-01-28 16:25:58 -08:00
swift-ci
d83705b3e1 Merge pull request #22161 from gottesmm/pr-3e0ca67a6062567588ea7d5d8d94f564f4266ab3 2019-01-28 12:54:49 -08:00
Michael Gottesman
cc68e6a0d5 Remove some remaining dead code from the +0 argument convention bring up.
I already removed the option from SILOptions, so all of this stuff is dead.
2019-01-27 13:18:06 -08:00
Ross Bayer
b88edd117e [Build System: CMake] Set the binary dir for the bundled apinotes to the source dir when building the standalone overlays. 2019-01-26 20:41:30 -08:00
Ross Bayer
7c84d14066 [Build System: CMake] Set the binary dir for the generated runtime headers to the source dir when building the standalone overlays (rdar://47558666). 2019-01-25 15:28:06 -08:00
Alex Langford
6c63f4d3f5 [CMake] Remove LINK_LIBRARIES option from _add_swift_executable_single
This option has been unused since commit
dd85d79105. We now use
target_link_libraries instead of this option.
2019-01-25 14:25:58 -08:00
Jordan Rose
bad30a5313 [CMake] Remove logic to set unused macro __SWIFT_CURRENT_DYLIB (#22105)
Once upon a time we tried to use this to limit the visibility of
symbols in the Swift runtime in a way that didn't really make sense.
Dave Z removed it last year in 91823273d2.

No functionality change.
2019-01-24 20:15:29 -08:00
Jordan Rose
77689f5945 Revert "Set a reasonable default for SWIFT_INSTALL_COMPONENTS" (#22079) 2019-01-23 19:35:09 -08:00
Robert Widmann
9c755e0e66 Merge pull request #21529 from coypoop/master
Fix typo regarding supported FreeBSD architectures
2019-01-23 12:30:18 -05:00
Ben Langmuir
753eb53f1c Merge pull request #21721 from benlangmuir/optionalize
[cmake] Make install of stdlib target libraries OPTIONAL
2019-01-22 16:19:06 -08:00
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