Commit Graph

1741 Commits

Author SHA1 Message Date
Saleem Abdulrasool
49a5098db4 build: update for cmark build revamp and split the build
Extricate cmark from the unified build system. This is preparatory work
to support building CMark GFM with dynamic linkage for sharing it across
swift-markdown and the compiler. It also simplifies the build logic for
the unified build.
2024-01-17 08:54:36 -08:00
Saleem Abdulrasool
8b66f23852 Merge pull request #70901 from compnerd/scan-deps
caches: include clang-scan-deps, clang-deps-launcher
2024-01-15 14:08:06 -08:00
Daniel Rodríguez Troitiño
449ef8af75 [CMake] Replicate what ClangConfig does for unified builds (#70890)
ClangConfig sets `CLANG_INCLUDE_DIRS` and Swift build system uses that
variable in a couple of places. Without this, several of the include
directories for Clang might not be added to different parts of the
compiler, like when using SwiftSourceSupport files. Before these
changes, headers like `clang/CAS/CASOptions.h` were not being found.
2024-01-13 07:57:43 -08:00
Saleem Abdulrasool
fdb1c5d4fb caches: include clang-scan-deps, clang-deps-launcher
Add a couple of additional tools to the toolchain distribution.
2024-01-12 15:34:52 -08:00
Rintaro Ishizaki
b39dba32f3 [CMake] Propagate header changes to pure Swift modules
Changes to the headers imported by Swift files aren't not correctly
propagated in CMake/Ninja. So changes to C/C++ headers didn't rebuild
ASTGen modules. Move the similar hack from SwiftCompilerSources and use
it in ASTGen as well.

rdar://120863405
2024-01-11 14:45:54 -08:00
Rintaro Ishizaki
362b555288 [CMake] Disable warnings for anonymous nested types
Some commit accidentally changed `-Wno-nested-anon-types` to
`-Wnested-anon-types`.
2024-01-09 11:44:13 -08:00
Saleem Abdulrasool
14be5e943d caches: enable static mirror lib on Windows
Enable building and installation for the static mirror library on
Windows.
2024-01-04 10:14:39 -08:00
Evan Wilde
2752414d78 Merge pull request #70680 from etcwilde/ewilde/emit-private-interface
Emit private interfaces on all swift libraries
2024-01-03 13:13:50 -08:00
Saleem Abdulrasool
43c5cf910c Merge pull request #70673 from compnerd/user
build: do not modify user variables
2024-01-03 09:44:28 -08:00
Saleem Abdulrasool
ddca28e51e Merge pull request #70669 from compnerd/simplify
build: simplify the unified build configuration
2024-01-03 07:59:58 -08:00
Evan Wilde
83a4a0be23 Emit private interfaces on all swift libraries
Swift-driver PR [1043](https://github.com/apple/swift-driver/pull/1043)
updated the new driver to always emit private swiftinterface files.
This was not carried back to the old driver, so attempting to bootstrap
the toolchain on a system that does not have the new driver fails to
install because we try to install the private swiftinterface on all
Swift targets.
2024-01-02 16:54:42 -08:00
Max Desiatov
672386c39f Merge pull request #70629 from apple/maxd/embedded-wasm
stdlib/public/CMakeLists.txt: Enable embedded Wasm
2024-01-02 23:42:44 +00:00
Saleem Abdulrasool
f75619fc4a build: do not touch the user specified flags
`CMAKE_CXX_FLAGS` are user controlled and should not be touched by the
build system [1]. Use global `add_compile_options` and
`add_compile_definitions` to control the flags for the targets.

[1] https://cmake.org/cmake/help/book/mastering-cmake/
2024-01-02 14:22:36 -08:00
Saleem Abdulrasool
d21c339a5d build: sink flag handling into global handling
This shuffles the warning from the unified build only to the global
build configuration.
2024-01-02 14:05:02 -08:00
Max Desiatov
c0673f9168 Add m68k to SwiftSetIfArchBitness.cmake (#70668)
`m68k` is a 32-bit architecture and should be defined as such in that file.
2024-01-02 13:16:24 -08:00
Saleem Abdulrasool
8b47616d6d build: simplify the unified build configuration
Conditionalise the inclusion of directory paths. If the include
directory is empty, CMake will raise an error. This allows us to disable
larger portions of the Swift build to speed up some of the build tool
configuration phase and prepares for consuming CMark GFM as a CMake
project.
2024-01-02 12:58:50 -08:00
Max Desiatov
22c42e1d3e Add wasm64 to SwiftSetIfArchBitness.cmake 2024-01-02 18:07:45 +00:00
Ben Barham
406d5337dc Merge pull request #69538 from finagolfin/android
[android] Add more changes to build the compiler
2023-12-15 10:57:21 -08:00
Rintaro Ishizaki
67af6a0e46 [CMake] Color diagnostics for swift sources
Color is nice.
2023-12-06 10:30:38 -08:00
Hamish Knight
73c6dcb551 [cmake] Fix LLDB for ASTGen
Add the swiftmodule paths for ASTGen via
`-add_ast_path` to the public linker flags such
that downstream linking picks them up, allowing
LLDB to load them when debugging. Also switch
SwiftCompilerModules to using public linker
flags instead of adding the linker flags in
`_add_swift_runtime_link_flags`.
2023-12-05 12:43:25 +00:00
Kuba Mracek
a0ec73ef42 [embedded] Start building embedded support on Linux/ELF, expand archs of the embedded stdlib to cover common embedded targets, take 2 2023-11-28 10:31:39 -08:00
Doug Gregor
130adac5c5 Revert "[embedded] Start building embedded support on Linux/ELF, expand archs of the embedded stdlib to cover common embedded targets" 2023-11-27 22:20:54 -08:00
Kuba (Brecka) Mracek
f7c5831830 Merge pull request #69973 from kubamracek/embedded-linux
[embedded] Start building embedded support on Linux/ELF, expand archs of the embedded stdlib to cover common embedded targets
2023-11-27 13:22:27 -08:00
Kuba Mracek
971ad79f37 [embedded] Start building embedded support on Linux/ELF, expand archs of the embedded stdlib to cover common embedded targets 2023-11-17 21:30:12 -08:00
Rintaro Ishizaki
abd416480f [Windows] Link host tools with 'swiftrt.obj'
swiftrt.obj is required for making things work
2023-11-16 11:01:32 -08:00
Saleem Abdulrasool
27c09fc873 Update Windows-aarch64.cmake
Add `swift-syntax-lib` to the distribution image for ARM64
2023-11-08 22:40:52 +00:00
Finagolfin
bf137cb30d [android] Add more changes to build the compiler 2023-11-06 21:53:56 +05:30
Hamish Knight
e5442fea50 [ASTGen] Enable C++ interop 2023-10-30 23:49:52 +00:00
Hamish Knight
b81e352cfb [cmake] Fix SWIFT_ANALYZE_CODE_COVERAGE
Pass the necessary linker flags as well as the
compile flags to generate coverage.
2023-10-29 14:07:17 +00:00
Ben Barham
360c5d8465 Merge remote-tracking branch 'origin/main' into 20231019-merge-main
Conflicts:
  - `lib/AST/TypeCheckRequests.cpp` renamed `isMoveOnly` which requires
    a static_cast on rebranch because `Optional` is now a `std::optional`.
2023-10-19 16:16:23 -07:00
Saleem Abdulrasool
13f13cf530 Update Windows-x86_64.cmake
Add `swift-syntax-lib` component to the distribution set.
2023-10-17 12:38:06 -07:00
Saleem Abdulrasool
2bab362663 build: make SWIFT_CLANG_LOCATION take precedence
If this is defined, prefer this compiler over the just built compiler.
2023-10-16 13:41:06 -07:00
Evan Wilde
24d0db249b Merge remote-tracking branch 'main' into 'rebranch'
Conflicts:
  CMakeLists.txt
    Take new BRIDGING_MODE

  SwiftCompilerSources/Sources/SIL/GlobalVariable.swift
    Take new
2023-10-09 17:21:23 -07:00
Erik Eckstein
2dbd6cc56b SwiftCompilerSources: rework bridging
Introduce two modes of bridging:
* inline mode: this is basically how it worked so far. Using full C++ interop which allows bridging functions to be inlined.
* pure mode: bridging functions are not inlined but compiled in a cpp file. This allows to reduce the C++ interop requirements to a minimum. No std/llvm/swift headers are imported.

This change requires a major refactoring of bridging sources. The implementation of bridging functions go to two separate files: SILBridgingImpl.h and OptimizerBridgingImpl.h.
Depending on the mode, those files are either included in the corresponding header files (inline mode), or included in the c++ file (pure mode).

The mode can be selected with the BRIDGING_MODE cmake variable. By default it is set to the inline mode (= existing behavior). The pure mode is only selected in certain configurations to work around C++ interop issues:
* In debug builds, to workaround a problem with LLDB's `po` command (rdar://115770255).
* On windows to workaround a build problem.
2023-10-09 09:52:52 +02:00
swift-ci
c746bf7e51 Merge remote-tracking branch 'origin/main' into rebranch 2023-10-08 10:54:42 -07:00
Saleem Abdulrasool
a2cc0d0468 Merge pull request #68780 from hjyamauchi/sourcekitclangdep
Fix the clang dependency of sourcekit libraries.
2023-10-08 10:41:57 -07:00
swift-ci
afb7498c55 Merge remote-tracking branch 'origin/main' into rebranch 2023-10-05 21:39:00 -07:00
Yuta Saito
053a75f3bf [wasm] Fix wrong SWIFT_THREADING_PACKAGE cmake cache
The actual value was accidentally placed in docstring field.
2023-10-05 22:48:51 +00:00
Ben Barham
119d08c6d1 Merge remote-tracking branch 'origin/main' into 20230929-merge-rebranch
Conflicts:
  - `CMakeLists.txt` caused by the extra `-D` added in rebranch to
    reduce the number of deprecation warnings.
  - `lib/Frontend/PrintingDiagnosticConsumer.cpp` caused by the removal
    of one of the `#if SWIFT_SWIFT_PARSER` on rebranch (probably should
    have been done on main).
2023-09-29 09:50:50 -07:00
Rintaro Ishizaki
8dbde04c61 Merge pull request #68408 from rintaro/fetch-content
[CMake] Replace early swift-syntax with FetchContent
2023-09-28 11:22:10 -07:00
Hiroshi Yamauchi
71d8118af9 Fix the clang dependency of sourcekit libraries.
Because swift_swap_compiler_if_needed updates the compiler ID to
Clang, we need to account for it when deciding to add a dependency on
clang. Otherwise, the sourcekit build could fail due to the clang
executable not having been built there yet.
2023-09-27 14:15:12 -07:00
swift-ci
7fc36edb98 Merge remote-tracking branch 'origin/main' into rebranch 2023-09-27 09:34:12 -07:00
Alastair Houghton
62c4999249 Merge pull request #68669 from al45tair/eng/PR-115774613
[Linux] Force the inclusion of the backtracing code when static linking.
2023-09-26 22:16:06 +01:00
swift-ci
daeae9870d Merge remote-tracking branch 'origin/main' into rebranch 2023-09-25 21:51:57 -07:00
Yuta Saito
48b6cd5e53 [wasm] Remove wrong SWIFT_HOST_VARIANT_ cmake caches
`NONE` is completely wrong and testing macro feature requires a valid
value of those cmake variables now for `config.host_triple`
2023-09-25 18:38:12 +00:00
Alastair Houghton
e1827448e5 [Linux][Build] Use host swiftrt.o when in HOSTTOOLS mode.
When we're building with host tools, we should use the host's swiftrt.o
and not the one we've just built when we're trying to build tools that we
will run on the host system.

rdar://115774613
2023-09-22 15:45:54 +01:00
Rintaro Ishizaki
0165f0979f [CMake] Improve argument list handling of force_target_link_libraries
The argument list handling was a hack and confusing.
2023-09-21 10:35:31 -07:00
Rintaro Ishizaki
f8f7109f7e [CMake] Use global SWIFT_HOST_TRIPLE consistently
Instead of calling 'get_swift_host_triple()' repeatedly, because it
always return the same value.
2023-09-21 09:59:17 -07:00
Guillaume Lessard
c8544d1ac2 Merge branch 'main' into rebranch
# Conflicts:
#	utils/build_swift/build_swift/defaults.py
2023-09-18 18:20:09 -07:00
Rintaro Ishizaki
8cb651bb69 [CMake] Introduce 'swift-syntax-lib' install component
So that swift-syntax host libraries can be installed independently.
2023-09-18 14:44:13 -07:00