Commit Graph

9 Commits

Author SHA1 Message Date
Hugh Bellamy
3ad0889847 Add GYB support for Windows 2016-12-22 11:02:59 +00:00
Michael Gottesman
7f06ef40dc [cmake] Instead of using EMIT_SIB to generate sib output, just generate targets
for sib/sibgen files for libraries without building them by default.

This will let engineers just cd into the build directory and type:

ninja swift-stdlib-sib
ninja swift-stdlib-sibgen

To generate sib and sibgen files respectively.

There are still some dependency issues in between the sib targets, so to get
this to work well, I would suggest doing a full build and then using these
targets.
2016-12-17 18:38:32 -08:00
Chris Bieneman
40e14e33c4 [CMake] Fix the Xcode generator
In PR 5182 I broke the Xcode generator in cases where the output path had ${CMAKE_CFG_INTDIR} in it. This broke because $(CONFIGURATION) is invalid in the name of a target.

Since all targets will have the same value for CMAKE_BINARY_DIR and CMAKE_CFG_INTDIR we can remove those from the target names and still have unique values.

This has the impact of shortening the generated target names so that the filename components are unlikely to hit OS limits using IDE generators where CMake generates Makefiles or scripts for custom commands. It also retains the debug ability that PR 5182 was attempting to add.
2016-10-07 19:32:37 -07:00
Chris Bieneman
85d44735fd [CMake] Don't use hashes in target names
This code was added in the mega-commit 6670bb7 with the commit message "Rewrite the CMake build system", so I'm a little bit light on context here. The comment in the code was:

# Construct a unique name for the custom target.
# Use a hash so that the file name does not push the OS limits for filename
# length.

This seems bunk to me. Since the string being hashed is a filename it seems to me that we don't need a hash to stay under the OS filename size limits. Additionally since output files must be unique using the filename as the unique target name seems like a good idea to me. The only issue here is that custom target names can't contain '/'s. To workaround that we replace the '/' character with '-'.

This patch has the added benefit of having the full filename encoded into the target names, so if you need to debug the build dependency graph you can much more easily walk back from the generated build files to the place in CMake where it was generated.
2016-10-07 13:39:19 -07:00
Brian Gesiak
3123b47602 [cmake] Enable IN_LIST compare policy
Enable CMake policy CMP0057, which allows `if()` statements to use the `IN_LIST`
operator. In addition, simplify several `if()` statements that used the
`list(FIND ...)` operation instead.
2016-09-28 22:35:05 -04:00
Michael Gottesman
c92f51a479 [cmake] Merge SwiftTranslateFlag.cmake into SwiftUtils.cmake
Both files are relatively small and contain utilities used by the build system.
So it makes sense to merge them.
2016-07-12 21:47:33 -07:00
Jordan Rose
c43943d7a8 [build-script] Remove -X option for "edit-only" Xcode projects.
This has caused plenty of confusion and should no longer be necessary anyway.
2016-03-16 09:28:52 -07: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
Dmitri Hrybenko
6670bb76ec Rewrite the CMake build system
Swift SVN r24124
2014-12-23 22:15:30 +00:00