Commit Graph

11 Commits

Author SHA1 Message Date
Kitware Robot
1772622772 LICENSE: Replace references to Copyright.txt with LICENSE.rst
```
git grep -lz 'Copyright.txt or https://cmake.org/licensing ' |
  while IFS= read -r -d $'\0' f ; do
    sed -i '/Copyright.txt or https:\/\/cmake.org\/licensing / {
              s/Copyright.txt/LICENSE.rst/
            }' "$f" ; done
```
2025-03-03 10:43:35 -05:00
Brad King
c07e915adb Merge topic 'swift-xcode-14.3'
52dbfefe0d Xcode: Fix detection of Swift compiler location for Xcode 14.3

Merge-request: !8388
2023-04-04 09:26:01 -04:00
Brad King
52dbfefe0d Xcode: Fix detection of Swift compiler location for Xcode 14.3
Previously we tried to match output from `xcodebuild` to detect the
path to the `swiftc` tool.  This approach is used for C and CXX
for historical reasons, but is unnecessary for Swift.  We know the
name of the tool, so we can just ask `xcrun --find swiftc`.

Fixes: #24666
2023-04-03 18:59:57 -04:00
YR Chen
006e1995eb Swift: Restore compatibility with old C++ driver
The `-wmo` flag added by commit 6063428de7 (Swift: Update default build
flags, 2022-10-03, v3.26.0-rc1~585^2~1) behaves differently with the old
driver.  Detect when the old driver is being used, and avoid adding that
flag.

Fixes: #24641
2023-03-28 10:02:05 -04:00
Fred Baksik
6f1af899db Toolchain: Capture all arguments from CMAKE_<LANG>_COMPILER
Capture CMAKE_<LANG>_COMPILER_ARG1 from CMAKE_<LANG>_COMPILER in the
same fashion that it is from $ENV{<LANG>}.

Since get_filename_component() returns a single string of all the
arguments from $ENV{<LANG>}, a single string of arguments will be
constructed from the items contained in CMAKE_<LANG>_COMPILER.

Fixes #20089
2020-07-23 14:52:48 -04:00
Saleem Abdulrasool
65b3848de0 Swift: support Ninja Multi-Config
Enable support for multi-configuration builds using Ninja when building
Swift.
2020-03-09 09:11:22 -04:00
Gregor Jasny
5c028c27eb Xcode: Relax swift compiler detection regex for Xcode 11
The Xcode 11 output:

```
  CompileSwift normal x86_64
  /Users/gregorj/Git/cmake/_build_xcode/Tests/SwiftOnly/CMakeFiles/3.15.20190826-g89479bd/CompilerIdSwift/CompilerId/main.swift
  (in target 'CompilerIdSwift' from project 'CompilerIdSwift')

      cd /Users/gregorj/Git/cmake/_build_xcode/Tests/SwiftOnly/CMakeFiles/3.15.20190826-g89479bd/CompilerIdSwift
      /Applications/Xcode-beta.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/swift -frontend -c -primary-file /Users/gregorj/Git/cmake/_build_xcode/Tests/SwiftOnly/CMakeFiles/3.15.20190826-g89479bd/CompilerIdSwift/CompilerId/main.swift ...
```

The Xcode 10 output:

```
CompileSwiftSources normal x86_64 com.apple.xcode.tools.swift.compiler
    cd /Users/gjasny/src/cmake/Tests/SwiftOnly
    /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/swiftc -incremental -module-name SwiftOnly -O -enable-batch-mode -enforce-exclusivity=checked -swift-version 5.0 -sdk /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.14.sdk -target x86_64-apple-macosx10.14 -g -Xfrontend -serialize-debugging-options -swift-version 5 -Xlinker -rpath -Xlinker /usr/lib/swift -I /Users/gjasny/src/cmake/_build_xcode/Tests/SwiftOnly/Debug -F /Users/gjasny/src/cmake/_build_xcode/Tests/SwiftOnly/Debug -c -j24 /Users/gjasny/src/cmake/Tests/SwiftOnly/main.swift ...

CompileSwift normal x86_64 /Users/gjasny/src/cmake/Tests/SwiftOnly/main.swift
    cd /Users/gjasny/src/cmake/Tests/SwiftOnly
    /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/swift -frontend -c -primary-file /Users/gjasny/src/cmake/Tests/SwiftOnly/main.swift ...

```

The Xcode 11 output lacks the CompileSwiftSources action but the
CompileSwift action is present for both and also look suitable.
2019-08-30 10:53:58 +02:00
Saleem Abdulrasool
e9b0063e8e Modules: add build rules for Swift Ninja support
Add rules to support building Swift sources using Ninja.
2019-05-16 14:41:05 -04:00
Brad King
acb4cb9500 CMakeFindBinUtils: Improve switch between MSVC- and GNU-like tools
The switch was not considering some languages, such as `ASM`.
Instead of memorizing the list of languages in the condition,
use a language specified by the includer.

Fixes: #17510
2017-11-28 07:57:58 -05:00
Brad King
86578eccf2 Simplify CMake per-source license notices
Per-source copyright/license notice headers that spell out copyright holder
names and years are hard to maintain and often out-of-date or plain wrong.
Precise contributor information is already maintained automatically by the
version control tool.  Ultimately it is the receiver of a file who is
responsible for determining its licensing status, and per-source notices are
merely a convenience.  Therefore it is simpler and more accurate for
each source to have a generic notice of the license name and references to
more detailed information on copyright holders and full license terms.

Our `Copyright.txt` file now contains a list of Contributors whose names
appeared source-level copyright notices.  It also references version control
history for more precise information.  Therefore we no longer need to spell
out the list of Contributors in each source file notice.

Replace CMake per-source copyright/license notice headers with a short
description of the license and links to `Copyright.txt` and online information
available from "https://cmake.org/licensing".  The online URL also handles
cases of modules being copied out of our source into other projects, so we
can drop our notices about replacing links with full license text.

Run the `Utilities/Scripts/filter-notices.bash` script to perform the majority
of the replacements mechanically.  Manually fix up shebang lines and trailing
newlines in a few files.  Manually update the notices in a few files that the
script does not handle.
2016-09-27 15:14:44 -04:00
Brad King
bf11253163 Add rudimentary support for the Apple Swift language with Xcode
Allow the `Swift` language to be enabled with the Xcode generator for
Xcode >= 6.1.  Reject it on other generators and with older Xcode
versions.  Since Apple is the only vendor implementing the language
right now, the compiler id can be just `Apple`.
2015-07-06 16:15:49 -04:00