Commit Graph

792 Commits

Author SHA1 Message Date
Saleem Abdulrasool
0bbc160a44 build: strength reduce add_dependencies usage
The two invocations here both had a single parameter passed to it.
Replace it with `add_dependencies` which already actually supports
multiple dependencies specified.  Sink the custom wrapper into the
usage location in `AddSwiftStdlib.cmake`.
2020-04-19 10:24:40 -07:00
Saleem Abdulrasool
8e736584fa build: remove ICU handling in the android host handling
The host tools do not use ICU, only the standard library does.  Remove
the special handling in the host tool path for ICU.  This simplifies the
flag computation and allows the ICU handling to be sunk entirely into
the target specific paths.
2020-04-19 10:24:40 -07:00
Saleem Abdulrasool
123c2b06dc build: convert output variables to target
Convert the out parameters for `_add_host_variant_c_compile_flags` to
use the target as an in-parameter.  Doing so allows us to set the
properties on the target directly rather than providing them as out
parameters which then get set subsequently.
2020-04-19 10:24:40 -07:00
Saleem Abdulrasool
9873280853 build: convert output variables to target
Convert the out parameters for `_add_host_variant_link_flags` to use the
target as an in-parameter.  Doing so allows us to set the properties on
the target directly rather than providing them as out parameters which
then get set subsequently.
2020-04-19 10:24:38 -07:00
Saleem Abdulrasool
2e132050e1 build: CF, CVP, DAE over flag computation
Perform some constant folding, constant value propagation, dead argument
elimination over the flag computation methods.  This reduces the
unnecessary parameters and more clearly and succinctly describes what is
happening.
2020-04-19 10:24:03 -07:00
Saleem Abdulrasool
6de2863468 build: CVP some of the flags handling
Apply constant value propagation to the host flag variant operations.
This reduces the parameters needed for the invocations and enables
further cleaning in the hopes that we can apply these per-target using
CMake instead.
2020-04-19 10:23:21 -07:00
Daniel Rodríguez Troitiño
6f4455812b Merge pull request #30235 from buttaface/rpath
[build][android] set INSTALL_RPATH properly for shared libraries
2020-04-18 15:38:23 -07:00
Saleem Abdulrasool
84d8bc7b43 build: merge _add_swift_host_executable_single into add_swift_host_executable
Merge the single use `_add_swift_host_executable_single` into the
singular site.  The host tools are built in a single variant.  This
avoids the custom logic for adding multiple variants.  Folding this
away will allow further simplifications in order to move towards a
standard CMake build.
2020-04-13 17:24:18 -07:00
Dario Rexin
20b2fec8a9 Merge pull request #30978 from compnerd/variants
build: duplicate and rename the `_add_variant_*` functions
2020-04-13 13:55:47 -07:00
Saleem Abdulrasool
3d1bfdedb6 Merge pull request #30977 from compnerd/unused
build: prune some unused options for `_add_swift_host_executable_single`
2020-04-11 16:05:17 -07:00
Saleem Abdulrasool
87cbb3132d build: duplicate and rename the _add_variant_* functions
This allows us to start splitting up the swift and C/C++ specific paths.
2020-04-11 13:24:31 -07:00
Saleem Abdulrasool
319a9e0cf0 build: prune some unused options for _add_swift_host_executable_single
Remove some unused parameters for this function.  This simplification
will make it easier to merge `_add_swift_host_executable_single` into
`add_swift_host_executable`.
2020-04-11 12:26:30 -07:00
Saleem Abdulrasool
7e2ca19ba8 build: remove Swift search paths for host
Remove the Swift library search path for the host paths which are C/C++
only.
2020-04-11 12:25:34 -07:00
Butta
4bfbfe935f [build][android] set INSTALL_RPATH properly for shared libraries
Host libraries will likely all need ORIGIN set, whereas only set it for
target libraries that will be packaged with a native toolchain on Android.
2020-03-18 10:32:49 +05:30
Eric Miotto
b3e86610fa [build] set linker parameters in a single way (#30339)
After noticing that also in CMake 3.16 the LINKER: prefix is not
expanded correctly when used in `target_link_options`, prefer to set the
linker parameters in a more verbose way and leave a comment behind on
when this behavior was observed in case we want to change the
implementation later.

Follow up to #29636.
Addresses rdar://problem/59732421
2020-03-11 07:41:50 -07:00
Saleem Abdulrasool
b40bd3ecba build: remove reference to handle_swift_sources in C++ path
The toolchain binaries are all C++ code.  This removes the last tie to
the custom Swift handling in CMake for the host functions.
2020-02-27 21:32:45 -08:00
Saleem Abdulrasool
fc67fc74fb build: shuffle around some functions
This is a purely code motion change.  It moves the functions that are
specific to `SwiftSource.cmake` into `SwiftSource.cmake`.  Target
functions are moved to `stdlib/cmake/modules/AddSwiftStdlib.cmake`.
2020-02-26 12:47:43 -08:00
Saleem Abdulrasool
2e2e886832 build: bifurcate _add_swift_executable_single 2020-02-23 14:20:12 -08:00
Michael Gottesman
79716efbee Merge pull request #29960 from compnerd/add-swift-host-library-single-simplifications
`_add_swift_host_library_single` simplifications
2020-02-20 23:26:52 -08:00
Michael Ilseman
bfd0de4928 Revert "Revert "Revert "swift-lang: shuffle the source directory structure (N…" 2020-02-20 15:39:51 -08:00
Saleem Abdulrasool
4b2cbd64f4 build: rename prefix for _add_swift_host_library_single 2020-02-20 09:10:00 -08:00
Saleem Abdulrasool
a32b479250 build: custom import libraries are not needed for host libraries 2020-02-20 09:10:00 -08:00
Saleem Abdulrasool
4a93f70e1f build: use a regular expression in _add_swift_host_library_single 2020-02-20 09:10:00 -08:00
Saleem Abdulrasool
749dd266c3 build: inline constant values for _add_swift_host_library_single 2020-02-20 09:10:00 -08:00
Saleem Abdulrasool
f11ecdec9c build: remove unnecessary set_target_property
Now that `_add_swift_host_library_single` only deals with host
libraries, it is no longer mutating the name of the library target.
This `set_target_property` is no longer needed.
2020-02-20 09:10:00 -08:00
Saleem Abdulrasool
56e58b4764 build: remove duplicated parameter to _add_swift_host_library_single 2020-02-20 09:09:59 -08:00
Saleem Abdulrasool
200b96df81 Revert "Revert "swift-lang: shuffle the source directory structure (NFC)""
This reverts commit beb8ecd8cc.  Add a
workaround for the dependency issue.

It is unclear why `sourcekitd` is getting added improperly as a
dependency on `lib/sourcekitd.framework/sourcekitd`.  This workaround
adjusts the dependency such that we end up with a dependency on
`lib/sourcekitd.framework/Versions/A/sourcekitd` as an order-only
dependency.  This should fix the compile issue.  I am unable to
reproduce this issue with the `add_library` usage for adding a Swift
library.  This allows us to cleave the host and target libraries, and so
the workaround is sufficient to make progress and the problem will be
resolved with the migration towards CMake for handling the dependencies.
2020-02-19 16:09:37 -08:00
Saleem Abdulrasool
697a44cf81 build: inline some variables in _add_swift_host_library_single 2020-02-16 13:53:38 -08:00
Saleem Abdulrasool
8430a0388f build: remove swiftCore workaround in _add_swift_host_library 2020-02-16 13:53:38 -08:00
Saleem Abdulrasool
d01312cc3e build: remove ICU references in _add_swift_host_library_single 2020-02-16 13:53:38 -08:00
Saleem Abdulrasool
dbd4ea05d7 build: remove unreferenced variable in _add_swift_host_library_single 2020-02-16 13:53:38 -08:00
Saleem Abdulrasool
cefb90d485 build: remove some un-valuved variables in _add_swift_host_library_single 2020-02-16 13:53:38 -08:00
Saleem Abdulrasool
bd60845eda build: simplify INSTALL_NAME_DIR computation in _add_swift_host_library_single 2020-02-16 13:53:38 -08:00
Saleem Abdulrasool
a8d9ab1537 build: cleanup unreferenced variable SWIFTLIB_SINGLE_EXTERNAL_SOURCES in _add_swift_host_library_single 2020-02-16 13:53:38 -08:00
Saleem Abdulrasool
4f516dad9a build: remove Swift support for _add_swift_host_library_single
The host libraries do not build Swift code, these libraries are C++
libraries used for the compiler.
2020-02-16 13:53:38 -08:00
Saleem Abdulrasool
3c9bb5a1df build: remove DARWIN_INSTALL_NAME_DIR from _add_swift_host_library_single 2020-02-16 13:53:38 -08:00
Saleem Abdulrasool
7235462e0a build: remove DEPLOYMENT_VERSION_* from _add_swift_host_library_single 2020-02-16 13:53:38 -08:00
Saleem Abdulrasool
546b9b6f8c build: remove SWIFT_COMPILE_FLAGS from _add_swift_host_library_single 2020-02-16 13:53:38 -08:00
Saleem Abdulrasool
626a1f418a build: remove FILE_DEPENDS from _add_swift_host_library_single 2020-02-16 13:53:37 -08:00
Saleem Abdulrasool
7f4b40678c build: remove INCORPORATE_OBJECT_LIBRARIES_SHARED_ONLY from _add_swift_host_library_single 2020-02-16 13:53:37 -08:00
Saleem Abdulrasool
b70b2b1dd0 build: remove INCORPORATE_OBJECT_LIBRARIES from _add_swift_host_library_single 2020-02-16 13:53:37 -08:00
Saleem Abdulrasool
36193c363b build: remove LINK_FLAGS from _add_swift_host_library_single 2020-02-16 13:53:37 -08:00
Saleem Abdulrasool
d1d70092ce build: remove FRAMEWORK_WEAK_DEPENDS from _add_swift_host_library_single 2020-02-16 13:53:37 -08:00
Saleem Abdulrasool
e4064fd0c4 build: remove FRAMEWORK_DEPENDS from _add_swift_host_library_single 2020-02-16 13:53:37 -08:00
Saleem Abdulrasool
7bc703e43a build: remove DEPENDS from _add_swift_host_library_single 2020-02-16 13:53:37 -08:00
Saleem Abdulrasool
fd74b30359 build: remove PRIVATE_LINK_LIBRARIES from _add_swift_host_library_single 2020-02-16 13:53:37 -08:00
Saleem Abdulrasool
5d1c760486 build: remove LINK_LIBRARIES from _add_swift_host_library_single 2020-02-16 13:53:37 -08:00
Saleem Abdulrasool
abb9d7db90 build: remove C_COMPILE_FLAGS from _add_swift_host_library_single 2020-02-16 13:53:37 -08:00
Saleem Abdulrasool
d3298646db build: remove MODULE_TARGETS from _add_swift_host_library_single 2020-02-16 13:53:37 -08:00
Saleem Abdulrasool
9f637d4e1e build: remove MODULE path from _add_swift_host_library_single 2020-02-16 13:53:37 -08:00