Commit Graph

95 Commits

Author SHA1 Message Date
Michael Gottesman
f6c2532552 [cmake] Remove standalone clang config code for building clang separate from llvm/swift.
We do not support this now. When we do, code can be added back.

rdar://26154980
2016-06-24 19:14:35 -07:00
Michael Gottesman
7f5116336a [cmake] Remove manual setting of include_directories for LLVM include dirs.
LLVM already provides these directories via the LLVMConfig.cmake variable
LLVM_INCLUDE_DIRS, which we are already using to import those directories.

Thus this work is and even worse gives the illusion that we are not delegating
the computation of LLVM's include paths to LLVM (which is really what we are
doing and should be doing).

rdar://26154980
2016-06-24 19:14:35 -07:00
Michael Gottesman
3168df8c11 [cmake] Do not set CMAKE_INCLUDE_CURRENT_DIR.
Setting this value is equivalent to setting:

include_directories(${CMAKE_CURRENT_BINARY_DIR} ${CMAKE_CURRENT_SOURCE_DIR})

in all subdirectories. Since these are all macros, this means that we are adding to the configuration
path the root swift directory. There is no reason to do this and will result in
confusion/bugs in the future.

rdar://26154980
2016-06-24 19:14:34 -07:00
Michael Gottesman
242fa0cd50 [cmake] Refactor out llvm related config from swift_common_standalone_build_config to swift_common_standalone_build_config_llvm.
*NOTE* The diff looks bigger than it actually is. This is just a pure
refactoring.

rdar://26154980
2016-06-24 18:32:34 -07:00
Michael Gottesman
5236f2d384 [cmake] Refactor out clang related config from swift_common_standalone_build_config to swift_common_standalone_build_config_clang.
rdar://26154980
2016-06-24 18:25:20 -07:00
Michael Gottesman
db964d35fc [cmake] Refactor out cmark related config from swift_common_standalone_build_config to swift_common_standalone_build_config_cmark.
This is apart of a series of patches that separates configuration of
llvm/clang/cmark in swift_common_standalone_build_config. Right now each project
has configuration occurring in a mixed up way. By refactoring it becomes much
easier to read the code.

rdar://26154980
2016-06-24 18:14:34 -07:00
Michael Gottesman
bd43806047 Merge pull request #3200 from gottesmm/use_swift_tablegen_instead_of_llvm_tablegen
Use swift tablegen instead of llvm tablegen
2016-06-24 18:09:46 -07:00
Michael Gottesman
25ac3a2df5 [cmake] Remove duplicate unncessary work.
Even before my changes, we had been setting this value twice. = /.

rdar://26154980
2016-06-24 17:51:24 -07:00
Michael Gottesman
5d984de9ec [cmake] Instead of setting LLVM_TABLEGEN_EXE, use our own SWIFT_TABLEGEN_EXE variable.
This eliminates us setting an LLVM_ prefixed variable in a situation where there is
a viable alternative.

We want to eliminate as many of these as possible since they can cause conflicts
with variables set in LLVMConfig.cmake.

I also added some convenience tablegen functions in AddSwiftTableGen.cmake and
changed all tblgen users to use that instead.

rdar://26154980
2016-06-24 17:18:45 -07:00
Michael Gottesman
41e375a8d2 [cmake] Instead of trying to find an absolute path to LLVMConfig.cmake, just add all of the LLVM cmake paths to the CMAKE_MODULE_PATH and just use include(LLVMConfig).
rdar://26154980
2016-06-24 15:22:10 -07:00
Michael Gottesman
d8be0e027b [cmake] When not cross compiling, instead of searching for llvm-tblgen, just use the real native cmake target.
This fixes part of the Xcode build by allowing us to avoid having to use cmake
variables with an unexpanded CMAKE_CFG_INTDIR.

Since those variables are not expanded, they point to a non-existant path like:

.../$(CONFIGURATION)$(...)/lib

So finding tablegen fails. In the cross compile case, we still try to find the
native tablegen.

rdar://26154980
2016-06-24 15:15:43 -07:00
Michael Gottesman
266ead97b9 [cmake] Remove support for invoking llvm-config.
I already removed the one invocation of llvm-config. This code is just dead.

rdar://26154980
2016-06-23 22:19:59 -07:00
Michael Gottesman
be112f18d1 [cmake] Use LLVM_TOOLS_BINARY_DIR from LLVMConfig.cmake and remove any invocation of llvm-config.
There are a couple of things going on in this patch. Lets consider first the
crosscompiling case.

In the cross compiling case, we were already setting LLVM_TOOLS_BINARY_DIR to
the binary dir of the just compiled LLVM (not the native LLVM/clang). This is
exactly what using LLVMConfig.cmake from that just compiled LLVM will set
LLVM_TOOLS_BINARY_DIR.

In the non-cross compiling case, we originally grabbed LLVM_TOOLS_BINARY_DIR
from llvm-config and then used that value to set the NATIVE llvm/clang paths.

rdar://26154980
2016-06-23 18:51:09 -07:00
Michael Gottesman
87fc9ca420 [cmake] Get the default value for LLVM_ENABLE_ASSERTIONS from LLVMConfig.cmake.
rdar://26154980
2016-06-23 18:47:33 -07:00
Michael Gottesman
ea3914d75e [cmake] Remove dead link directory.
This was added some time ago in case we want to build clang separate from llvm
just like we do swift. We do not actually support that though.

Currently, this just results in the main llvm binary directory being added for a
second time to the link path (i.e. this work iw asted). Thus just remove the
line but leave in a *NOTE* to deliver the message that this is where the clang
link path in such a case would need to go.
2016-06-23 17:47:48 -07:00
swift-ci
b2240d0ef0 Merge pull request #3158 from gottesmm/cmake_fix_bug_and_remove_dead_store 2016-06-23 00:33:10 -07:00
Michael Gottesman
8c3bc0a211 [cmake] Remove dead variable.
This variable was added in 2015 to set a value that was needed given upstream
changes. In Feb 2016, we started importing LLVMConfig.cmake. LLVMConfig.cmake
provides this value for us. Thus we can remove the dead variable.

rdar://26154980
2016-06-22 23:36:31 -07:00
Michael Gottesman
ef87fe7ba3 [cmake] Remove dead set (i.e. LLVM_MAIN_INCLUDE_DIR already equals LLVM_MAIN_SRC_DIR/include).
rdar://26154980
2016-06-22 23:16:33 -07:00
Michael Gottesman
8389dae8fb [cmake] Remove line of code that is setting LLVM_BINARY_DIR to CMAKE_BINARY_DIR (i.e., SWIFT_BINARY_DIR).
This bug was in tree before I began to make my changes. I uncovered the bug when
I was thinking about whether or not this line of code was dead and thus looked
at how it was used.

rdar://26154980
2016-06-22 23:16:33 -07:00
Michael Gottesman
e24e1f7dee [cmake] Use LLVMConfig.cmake instead of llvm-config to set some variables.
Previously in order to support cross-compiling, we were setting these variables
in build-script. Now that we are using LLVMConfig.cmake, passing in these values
are no longer necessary. As an added benefit, Swift when not cross compiling,
does not need to set these variables anyways.

rdar://26154980
2016-06-22 19:58:20 -07:00
Michael Gottesman
c87aabb79b [cmake] Use already defined ${product}_PATH_TO_LLVM_{SOURCE,BUILD} values instead of re-setting it later ot the same value.
Before this patch, we would always set ${product}_PATH_TO_LLVM_{SOURCE,BUILD} to
a value taken from llvm-config. But, turns out we had generated llvm-config
using these values. Thus llvm-config is just giving us back values we already
have.

This commit changes these variables to be precondition variables and doesn't
cause them to be reset.

rdar://26154980
2016-06-22 19:58:19 -07:00
Saleem Abdulrasool
b604369fb2 build: include more directories
llvm/Support/Compiler.h recently grew a dependency on llvm-config.h.  This
pointed out that we were not including the path to the generated header
directory in the build output.  Ensure that we have the corresponding -I.
2016-06-18 17:41:45 -07:00
practicalswift
befbebcd30 [gardening] "OSX" → "OS X" 2016-04-11 23:12:40 +02:00
practicalswift
abfecfde17 [gardening] if ([space]…[space]) → if (…), for(…) → for (…), while(…) → while (…), [[space]x, y[space]] → [x, y] 2016-04-04 16:22:11 +02:00
Saleem Abdulrasool
8454cdbe55 Use the new LLVM cmake paths
Update the paths that we look in for the cmake modules from LLVM which changed
recently on SVN trunk.  Check the old paths first, and if that fails, check the
new path.  This permits building against either layout.
2016-02-16 15:15:10 -08:00
Michael Gottesman
6da11cec7b Make sure that even in the standalone build configuration, we can build doxygen documentation.
The issue is that this was originally done when in-tree builds were the
preferred way of building so LLVM_ENABLE_DOXYGEN would be defined and LLVM would
have found doxygen as well. When one is doing the current preferred standalone
install, the option LLVM_ENABLE_DOXYGEN is not discoverable to the user via an
option with a default argument and the doxygen package is never searched for.

This commit ensures that when building standalone:

1. LLVM_ENABLE_DOXYGEN is defined as an option with a default value of FALSE.
2. The cmake dtrace package is searched for and found.

When we are building standalone, we take these values from LLVM.
2016-01-09 21:10:45 -08:00
Lijun Xue
ab6890fa5e Fix typos in comments 2015-12-03 20:44:23 -08:00
John McCall
5203a688f6 Pick up LLVM_PACKAGE_VERSION correctly in unified builds. 2015-11-17 12:33:17 -08:00
Argyrios Kyrtzidis
7c5de8fca5 [CMake] Make sure the standalone build enables the same warnings as the llvm/clang build. 2015-11-05 19:25:43 -08:00
Jordan Rose
6bc2234409 Revert "[cmake] Turn on the -Wbool-conversion flag." (r32925)
I complained about not having this to Michael, but it turns out it's on by
default and just doesn't catch the issue we ran into.

Swift SVN r32931
2015-10-28 01:13:41 +00:00
Michael Gottesman
4b63ffc136 [cmake] Turn on the -Wbool-conversion flag.
This would have caught a problem caused by an upstream source code change in the
merge.

Swift SVN r32925
2015-10-27 23:54:00 +00:00
Argyrios Kyrtzidis
f3b8a5898f [CMake/build-presets] Add 'clang-libclang' install component that installs libclang and pass the clang version via darwin-llvm-submit-version.
rdar://22907181

Swift SVN r32707
2015-10-15 16:52:22 +00:00
Jordan Rose
9f7a750f2a [CMake] Restore code that was previously guarded by "NOT MSVC_IDE".
Swift SVN r31549
2015-08-27 22:48:36 +00:00
Jordan Rose
765fab169a [CMake] Don't pretend to support MSVC.
These might very well be the right things to do, but no one's tested that.

Swift SVN r31537
2015-08-27 18:47:27 +00:00
Dmitri Hrybenko
7cdcb16cc4 CMake: LLVMParseArguments.cmake was removed, migrate to cmake_parse_arguments
Swift SVN r29699
2015-06-25 22:01:37 +00:00
Justin Bogner
b0e7cbd9e0 CMake: Use the USES_TERMINAL option for tests
This allows `ninja check` to display the lit progress bar when using a
new enough cmake+ninja combination, as it does in LLVM these days.

Swift SVN r27923
2015-04-29 21:30:32 +00:00
John McCall
3546d03462 Fix the unified build with cmark. Thanks to David Farler for
pointing out where I needed to look.

Swift SVN r27829
2015-04-27 23:04:13 +00:00
David Farler
ca5876a866 swiftMarkup Library
Replace ReST-flavored documentation comments with Markdown.

rdar://problem/20180412

In addition to full Markdown support, the following extensions are
supported. These appear as lists at the top level of the comment's
"document". All of these extensions are matched without regard to
case.

Parameter Outlines
------------------

- Parameters:
  - x: ...
  - y: ...

Separate Parameters
-------------------

- parameter x: ...
- parameter y: ...

- Note:
Parameter documentation may be broken up across the entire comment,
with a mix of parameter documentation kinds - they'll be consolidated
in the end.

Returns
-------

- returns: ...

The following extensions are also list items at the top level, which
will also appear in Xcode QuickHelp as first-class citizens:

- Attention: ...
- Author: ...
- Authors: ...
- Bug: ...
- Complexity: ...
- Copyright: ...
- Date: ...
- Experiment: ...
- Important: ...
- Invariant: ...
- Note: ...
- Postcondition: ...
- Precondition: ...
- Remark: ...
- Remarks: ...
- See: ...
- Since: ...
- Todo: ...
- Version: ...
- Warning: ...

These match most of the extra fields in Doxygen, plus a few more per request.

Other changes
-------------
- Remove use of rawHTML for all markup AST nodes except for those
not representable by the Xcode QuickHelp XSLT - <h>, <hr/>, and of
course inline/block HTML itself.

- Update the doc comment RNG schema to more accurately reflect Xcode
QuickHelp.

- Clean up cmark CMake configuration.

- Rename "FullComment" to "DocComment"

- Update the Swift Standard Documentation (in a follow-up commit)

- Update SourceKit for minor changes and link against cmark
  (in a follow-up commit).

Swift SVN r27727
2015-04-26 00:07:15 +00:00
Jordan Rose
38752c2d92 [CMake] Move swift_llvm_config to SwiftSharedCMakeConfig (for SourceKit).
...and rename it to swift_common_llvm_config.

This is the function that acts like llvm_config but handles the LLVM build
being a different configuration from the Swift (or SourceKit) build, which
can be problematic for multi-configuration build schemes like Xcode.

There's also one fix here: LLVM dependencies for dylibs weren't being
properly added. (This is the "SHARED_LIBRARY" case near the bottom.)

Swift SVN r26631
2015-03-27 16:36:43 +00:00
Dmitri Hrybenko
27f0e7b46e CMake: adapt to upstream CMake changes
Swift SVN r26604
2015-03-26 22:28:15 +00:00
David Farler
b60613458b cmark Build Support
<rdar://problem/20180372>

Build cmark alongside llvm and clang.
If the clone doesn't exist, build-script-impl will clone it in the
workspace. Also update the README and update-checkout scripts.

Swift SVN r26364
2015-03-20 22:32:19 +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
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