Commit Graph

1741 Commits

Author SHA1 Message Date
Graham Batty
d95d458634 Make SwiftUnstable build on linux.
Also in this is switching to using sysconf instead of sysctlbyname
to determine hardware concurrency, since it's more portable and
also works on OSX/iOS.

Swift SVN r25782
2015-03-05 16:35:17 +00:00
Michael Gottesman
3ffe8eca7c Search for dtrace in SwiftHandleDTraceSources.cmake instead of the root CMakeLists.txt.
Swift SVN r25648
2015-03-01 00:26:00 +00:00
Greg Parker
26d80cf470 [build] Fix 16K segment alignment on iOS.
Swift SVN r25628
2015-02-28 00:30:12 +00:00
Argyrios Kyrtzidis
7262217319 [CMake] Move the KEYWORD-for-target_link_libraries workaround into SwiftSharedCMakeConfig.cmake
so SourceKit can also automatically use it.

Thanks to Dmitri for the tip!

Swift SVN r25527
2015-02-25 02:53:34 +00:00
Dmitri Hrybenko
fe5d88ad20 CMake: prevent LLVM's CMake files from overriding Swift's assertion
configuration

rdar://19723473 rdar://19722119

Swift SVN r25413
2015-02-20 03:26:02 +00:00
Michael Gottesman
186f03346a Forgot to include the .cmake for r25264.
Swift SVN r25265
2015-02-13 06:47:37 +00:00
Michael Gottesman
6ff94330ae Add SwiftRuntime dtrace provider with probes for retain, release, allocateObject, deallocateObject.
Now if you want to get these dynamic metrics from the runtime all you
need to do is:

1. Configure Swift with -DSWIFT_RUNTIME_ENABLE_DTRACE=YES
2. Run your routine with the command:

sudo dtrace -s ./utils/runtime_statistics.d -c "$MY_COMMAND_LINE"

After your app finishes running, it will dump out the counts. This is a
much more efficient and low maintenance way to get such statistics than
custom instrumenting the code.

Nothing is changed if -DSWIFT_RUNTIME_ENABLE_DTRACE is not set.

Swift SVN r25264
2015-02-13 06:42:37 +00:00
Greg Parker
6aa98d9c10 [build] Fix __TEXT,__info_plist and -Wl,-application_extension settings.
Swift SVN r25160
2015-02-11 02:58:57 +00:00
Dmitri Hrybenko
6058d291ca CMake: allow the SDK overlay to be built separately from the compiler
and the stdandard library

rdar://19703353

Swift SVN r25139
2015-02-10 21:57:03 +00:00
John McCall
2ff77a9cd1 Only import *Ref typedefs as CF types if they have a bridging
attribute or appear in a whitelist.

The initial whitelist is based on an audit I performed of our current
public SDKs.  If there are CF types which appear only in our internal
SDKs, and somebody urgently needs to use them from Swift, they can
adopt the bridging attributes.  The goal is to eventually eliminate
the whitelist and rely solely on bridging attributes anyway.

Sadly, CoreCooling was not included in my SDK audit and must be
explicitly annotated. :(

I've left the main database organized by framework, but I wanted
a quasi-lexicographically sorted version to permit efficient lookup.
We generate that copy automatically with gyb.  I ended up having
to tweak handle_gyb_sources to allow it to drop the result in
CMAKE_CURRENT_BINARY_DIR instead of CMAKE_CURRENT_BINARY_DIR/{4,8}
if an architecture is not provided.  I think this is abstractly
reasonable for generated includes, which have independent ability
to detect the target word size.  But just between you and me,
I did it because I couldn't figure out how to add
"-I${CMAKE_CURRENT_BINARY_DIR/{4,8}" as a compile flag;
the obvious thing didn't work.  Anyway, I'd appreciate it if
someone double-checked my cmake hackery here.

Swift SVN r24850
2015-01-30 18:39:07 +00:00
Dmitri Hrybenko
df2b4bb488 CMake: more precise dependencies for gyb'ed files
Swift SVN r24730
2015-01-26 09:37:00 +00:00
Sonny Falk
6743b8e83c [CMake] Fix unified build
Make sure SWIFT_NATIVE_LLVM_TOOLS_PATH and SWIFT_NATIVE_CLANG_TOOLS_PATH
are set even when not building standalone.

Swift SVN r24726
2015-01-26 06:52:32 +00:00
Sonny Falk
1c63eeee65 [CMake] CMake script refactoring for better code sharing between Swift and SourceKit.
Swift SVN r24713
2015-01-25 01:36:40 +00:00
Sonny Falk
f190c2de81 [CMake, build-script] Add support for cross-compiling tools.
This adds support to build-script and cmake scripts for cross-compiling the host tools in addition to stdlib.

To cross-compile, build-script-impl now accepts --cross-compile-tools-deployment-targets with a space separated list of targets to cross compile host Swift tools for.

For example: $ build-script ...other-args... -- --cross-compile-tools-deployment-targets="iphoneos-arm64 iphoneos-armv7".

When installing cross-compiled tools, it now also merges and runs lipo to produce fat binaries by merging the cross-compiled target architectures.

Swift SVN r24712
2015-01-25 01:36:02 +00:00
Dmitri Hrybenko
cb2870c230 Update Unicode data files to 7.0.0
rdar://17561742

Swift SVN r24692
2015-01-23 22:17:45 +00:00
Dmitri Hrybenko
458640ef2a CMake: don't rely on autolinking when building Swift code
Autolinking is only available on Apple platforms.

Swift SVN r24685
2015-01-23 08:33:32 +00:00
Erik Eckstein
7446cee72b Re-enable SLPVectorizer in stdlib build (revert r24342 and r24345)
The SLPVectorizer is now faster (rdar://problem/19430955): it needs 2.5% of stdlib compile time.
Related radar: rdar://problem/19433841



Swift SVN r24511
2015-01-19 15:22:33 +00:00
Dmitri Hrybenko
72a26f2371 CMake: simplify passing swift driver parameters
Swift SVN r24440
2015-01-15 04:44:58 +00:00
Mark Lacey
387418d034 Document the need to reenable the SLP vectorizer for the stdlib.
Swift SVN r24345
2015-01-10 01:09:31 +00:00
Mark Lacey
211cc83e4e Disable the LLVM SLP vectorizer for the stdlib build.
This shaves around 5 seconds off the stdlib build if you're using a
release/no-assert LLVM (so around 12.5% of total time if you're also
using a release/no-assert swift, or around 4% of total time if you're
using a debug/assert swift).

The underlying LLVM issue is tracked by rdar://problem/19430955.

I saw no significant reproducible performance loss due to this change.

Resolves rdar://problem/19431821.

Swift SVN r24342
2015-01-10 00:51:08 +00:00
Greg Parker
6c6863e342 [cmake] Remove a reference to a dead variable.
Swift SVN r24289
2015-01-09 00:18:04 +00:00
Michael Gottesman
9243f82d08 [cmake] Add new option --extra-swift-options that enables one to pass cmake flags to specific libraries by pattern matching a regexp upon their name.
Often times one wants to pass certain flags to swift when building
specific libraries and not others. This has in the past required
manually modifying the cmake system. This new option allows one to use
string regexps based on the module_name of a library to enable and
disable various flags. The way this works is you pass the following into
build-script:

--extra-swift-options="${REGEX1};${FLAGS1_WITH_SEMICOLONS_ESCAPED}"
--extra-swift-options="${REGEX2};${FLAGS2_WITH_SEMICOLONS_ESCAPED}"
--extra-swift-options="${REGEX3};${FLAGS3_WITH_SEMICOLONS_ESCAPED}"
--extra-swift-options="${REGEX4};${FLAGS4_WITH_SEMICOLONS_ESCAPED}"
--extra-swift-options="${REGEX5};${FLAGS5_WITH_SEMICOLONS_ESCAPED}"

Every library that matches REGEPN will have FLAGSN_... appended to their
swift flags. For instance if I did the following:

build-script --extra-swift-options="Swift;-Xfrontend\;-sil-print-pass-name" --extra-swift-options='^Swift$;-Xllvm\;-debug-only=sil-arc-opts" ...

CMake will output the following:

-- Matched 'Swift' to module 'Swift'. Compiling Swift with special flags: -Xfrontend;-sil-print-pass-name
-- Matched '^Swift$' to module 'Swift'. Compiling Swift with special flags: -Xllvm;-debug-only=sil-arc-opts
-- Matched 'Swift' to module 'SwiftExperimental'. Compiling SwiftExperimental with special flags: -Xfrontend;-sil-print-pass-name
-- Matched 'Swift' to module 'SwiftStructures'. Compiling SwiftStructures with special flags: -Xfrontend;-sil-print-pass-name
-- Matched 'Swift' to module 'SwiftStructuresGraphBFS'. Compiling SwiftStructuresGraphBFS with special flags: -Xfrontend;-sil-print-pass-name

stating which regexp was matched, the module it was matched to and the
added flags. This ensures that one only gets matches for what one wants.

Swift SVN r24271
2015-01-08 06:33:09 +00:00
Arnold Schwaighofer
292ecc49ca Revert "Readd SWIFT_STDLIB_CORE_EXTRA_FLAGS added in r24055"
This reverts commit r24248.

The flag was just renamed to SWIFT_EXTRA_EXPERIMENTAL_FLAGS_STDLIB_CORE.

Swift SVN r24251
2015-01-08 00:03:49 +00:00
Arnold Schwaighofer
a3b757066e Readd SWIFT_STDLIB_CORE_EXTRA_FLAGS added in r24055
This got lost in the cmake upgrade.

Swift SVN r24248
2015-01-07 23:42:22 +00:00
Dmitri Hrybenko
4f080f8bdc CMake: remove dead code for old AddressSanitizer setup
Swift SVN r24244
2015-01-07 21:05:22 +00:00
Joe Groff
5d5986a44f cmake: Add a SWIFT_XCODE_GENERATE_FOR_IDE_ONLY flag.
This flag disables the generation of dependency targets that are necessary to accurately rebuild Swift code, but which completely tank the Xcode IDE experience. Since Xcode is primarily useful as a source editor/navigator for the compiler C++ code, and Ninja is a more performant and featureful build system for Swift at this point, provide a mode that generates enough of an Xcode project to edit the Swift compiler source, but which can't build it, as a compromise so we can use Xcode's editor alongside a Ninja build environment.

Swift SVN r24186
2015-01-05 22:29:43 +00:00
Argyrios Kyrtzidis
e4d1f7523f [CMake] In '_compile_swift_files' function, 'objdir' is supposed to be set to the parent path, not the filename.
This worked in standalone build by creating a directory that never got used but it failed in a non-standalone build.
Fix tracked with Dmitri's help.

Swift SVN r24180
2015-01-05 18:47:49 +00:00
Dmitri Hrybenko
269de5fa7f CMake: allow mixed configurations of LLVM and Swift with Xcode
Swift SVN r24177
2015-01-05 07:18:13 +00:00
Dmitri Hrybenko
5ff0612224 CMake: stop using LLVM_COMMON_LIBS, it is not set anywhere
Swift SVN r24174
2015-01-05 07:18:10 +00:00
Dmitri Hrybenko
6670bb76ec Rewrite the CMake build system
Swift SVN r24124
2014-12-23 22:15:30 +00:00
Dmitri Hrybenko
e954ac9534 CMake: normalize checks for Apple operating systems
Swift SVN r23056
2014-11-01 04:14:36 +00:00
Graham Batty
d269d5c656 Basic: Add dependency finding for libuuid.
Swift SVN r22434
2014-10-01 19:05:46 +00:00
Greg Parker
dbf9d8db89 Reinstate macosx.cmake because the B&I build script uses it.
Swift SVN r21668
2014-09-03 02:19:26 +00:00
Dave Abrahams
1f2242da97 Remove unused .cmake file
Swift SVN r21665
2014-09-03 00:39:17 +00:00
Dave Abrahams
f1a5acb3ba distcc support for ios device and simulator
Swift SVN r21664
2014-09-03 00:38:39 +00:00
Doug Gregor
1c1462ff6b CMake: when building a static library, add a dummy .c file.
This works around an apparent Xcode bug that prevented the generated
project from properly building static libraries when all of the inputs
were Swift sources. Building static libraries works fine now in Xcode.

Swift SVN r19956
2014-07-14 22:35:24 +00:00
Jordan Rose
4f79534a2c [CMake] Hack around LLVM's inability to check the flags of cross-compilers.
Assume Xcode's Clang supports -std=c++11.

This should unstick the iOS simulator and device builds.

Swift SVN r14622
2014-03-03 23:45:35 +00:00
Jordan Rose
118c4c8902 [cmake] Get CMake 2.8.12 to stop complaining about @rpath for iOS builds.
...by pretending to be OS X 10.9. This might remove the need for other
workarounds as well, but I'm not going to go track those down right now.

Swift SVN r13886
2014-02-14 01:27:14 +00:00
Greg Parker
5df9849939 [build] Use XcodeDefault.toolchain to build iOS stdlibs.
Swift SVN r12954
2014-01-25 07:18:22 +00:00
Greg Parker
dfd6bac8ac [build] Disable compiler version checks for the stdlib build.
The Swift stdlib build uses CMAKE_FORCE_C_COMPILER to cross-compile. 
When the compiler is forced cmake does not set the compiler version 
variables that llvm's build started checking in llvm commit bf2609e26.


Swift SVN r12311
2014-01-15 03:25:41 +00:00
Greg Parker
c1eb091fc5 Move CMake toolchain files to a separate directory.
Swift SVN r9558
2013-10-21 21:05:36 +00:00