Commit Graph

106 Commits

Author SHA1 Message Date
Ben Boeckel ac8879ce91 Ninja: Add order-only dependencies to link commands (#14728)
A library or executable target that consists only of a reference to an
object library may have no sources to compile or custom commands to run.
The command in the target is the link (or archive) command.  Add missing
order-only dependencies to link commands so that target ordering
dependencies are satisfied for it without depending on an intermediate
compilation rule.

Extend the ObjectLibrary test to cover this case.

Co-Author: Brad King <brad.king@kitware.com>
2014-07-01 10:14:28 -04:00
Brad King 5d12b87b9d cmGeneratorTarget: Improve GetCreateRuleVariable API
Pass the language and configuration to the method so it can return the
complete rule variable name.
2014-05-21 09:38:24 -04:00
Brad King 60d1882a67 Merge topic 'ninja-link-with-compile-flags'
97f2b7f5 Ninja: set correct LANGUAGE_COMPILE_FLAGS when linking
49fcffc6 Ninja: cmake formatting, make code more readable
b735c8cb MinGW: link like on Unix and use compile flags when linking
2014-04-15 10:22:32 -04:00
Peter Kümmel 97f2b7f5ab Ninja: set correct LANGUAGE_COMPILE_FLAGS when linking 2014-04-15 10:17:06 -04:00
Peter Kümmel 49fcffc6cc Ninja: cmake formatting, make code more readable 2014-04-15 10:17:06 -04:00
Peter Kümmel 504bb62d99 Ninja: replace \ in LINK_PATH for MinGW 2014-04-15 10:14:50 -04:00
Jiri Malak cb9b1e13e4 Watcom: Use single quote for all file/path items in wlink command
Watcom Linker use single quote if necessary for quoting target name,
libraries names and libraries search path.  Object names were already
fixed.
2014-04-08 13:28:54 -04:00
Brad King 5376151aa1 Merge topic 'target-transitive-sources'
9407174b target_sources: New command to add sources to target.
81ad69e0 Make the SOURCES target property writable.
6e636f2e cmTarget: Make the SOURCES origin tracable.
3676fb49 cmTarget: Allow transitive evaluation of SOURCES property.
e6971df6 cmTarget: Make the source files depend on the config.
df753df9 cmGeneratorTarget: Don't add computed sources to the target.
869328aa cmComputeTargetDepends: Use valid config to compute target depends.
2014-04-03 12:51:53 -04:00
Stephen Kelly e6971df6ab cmTarget: Make the source files depend on the config.
Disallow the use of config-specific source files with
the Visual Studio and Xcode generators. They don't have
any way to represent the condition currently.

Use the same common-config API in cmQtAutoGenerators. While
it accepts config-specific files, it doesn't have to support
multiple configurations yet.

Loop over the configs in cmTargetTraceDependencies
and cmGlobalGenerator::WriteSummary and consume all source
files.

Loop over the configs in cmComputeTargetDepends and compute the
object library dependencies for each config.
2014-04-02 23:14:02 +02:00
Jiri Malak 2b89675256 Ninja: Simplify code for linker commands
Use GetCreateRuleVariable function instead of redundant code for Rule
variable name.  Use temporary variables to improve code.
2014-04-01 10:58:58 -04:00
Brad King bc993f277e Generalize cmCustomCommandGenerator to more fields
Until now the cmCustomCommandGenerator was used only to compute the
command lines of a custom command.  Generalize it to get the comment,
working directory, dependencies, and outputs of custom commands.  Update
use in all generators to support this.
2014-03-12 10:44:01 -04:00
Brad King cb8f87f622 Merge topic 'remove-c_str-calls'
3be265b3 Workaround Sun C++ 5.9 compiler crash
af8a1643 Remove c_str calls when using stream APIs.
21c573f6 Remove some c_str() calls.
2014-03-12 10:42:38 -04:00
Stephen Kelly 21c573f682 Remove some c_str() calls.
Use the clang RemoveCStrCalls tool to automatically migrate the
code. This was only run on linux, so does not have any positive or
negative effect on other platforms.
2014-03-11 15:03:50 +01:00
Adrien Destugues 6c90f0a693 Ninja: Detect command-line length limit on Haiku 2014-03-10 09:42:38 -04:00
Ben Boeckel 270eb96df0 strings: Remove cmStdString references
Casts from std::string -> cmStdString were high on the list of things
taking up time. Avoid such implicit casts across function calls by just
using std::string everywhere.

The comment that the symbol name is too long is no longer relevant since
modern debuggers alias the templates anyways and the size is a
non-issue since the underlying methods are generated since it's
inherited.
2014-03-08 13:05:35 -05:00
Ben Boeckel fabf1fbabb stringapi: Use strings in target name 2014-03-08 13:05:31 -05:00
Ben Boeckel ce5114354c stringapi: Use strings for the languages 2014-03-08 13:05:30 -05:00
Peter Kümmel 7605e37aab Ninja: job pool support for compiling and linking
Could be tested by setting the environment
variable NINJA_STATUS=[%r]
2013-11-25 22:23:24 +01:00
Stephen Kelly c34968a9aa Port some of the generator API to cmGeneratorTarget.
Just enough to reach the BuildMacContentDirectory method and the
NeedRelinkBeforeInstall methods.

In the future, those methods can be moved to cmGeneratorTarget.
2013-11-22 15:06:25 +01:00
Stephen Kelly 50d152035d cmTarget: Make custom command accessors API const.
Add specific mutators instead of providing non-const refs.
2013-11-19 20:40:31 +01:00
Peter Kümmel eeb4aece1c Ninja: use deps = gcc/msvc feature
cmcldeps is now only used for .rc file processing
2013-10-24 19:48:18 +02:00
Clinton Stimpson 603bc5998f OS X: Fix regression handling frameworks for Ninja
Fix a regression created by commit 373faae5 (Refactor how bundles and
frameworks are supported, 2013-05-05).

Since the ninja file isn't aware of how framework symlinks work, we
suppress symlink creation and let cmOSXBundleGenerator handle it.  Also,
use the real name of framework library in build rules as was done
before, instead of the symlink.
2013-07-22 09:40:11 -04:00
Stephen Kelly 0416c94f64 Revert "Use --sysroot when cross compiling."
This reverts commit de4da665d3.

This feature is not yet ready for release. It needs to be
merged with the CMAKE_OSX_SYSROOT feature.
2013-07-12 15:44:38 +02:00
Robert Maynard 874e17120d Ninja: GlobalNinjaGenerator WriteBuild and WritePhonyBuild non static
To properly track the usage of dependencies that are generated at
compile time as the side effect of other build steps we need
to make the WriteBuild and WritePhonyBuild commands non static
2013-07-01 08:59:38 -04:00
Brad King b2d70c1a20 Merge topic 'set-sysroot'
de4da66 Use --sysroot when cross compiling.
2013-06-24 08:46:12 -04:00
Stephen Kelly 2331b57bec Add whitespace after colons in error messages. 2013-06-21 16:21:44 +02:00
Stephen Kelly de4da665d3 Use --sysroot when cross compiling.
As CMAKE_ROOT_FIND_PATH can be a list, a new CMAKE_SYSROOT is
introduced, which is never a list.

The contents of this variable is passed to supporting compilers
as --sysroot. It is also accounted for when processing implicit
link directories reported by the compiler, and when generating
RPATH information.
2013-06-07 13:32:52 +02:00
Brad King 05e47f2122 Merge topic 'cfbundle-location'
483e208 OS X:  Fix getting of CFBundle LOCATION property.
2013-06-04 09:02:46 -04:00
Brad King b0759da303 Merge topic 'framework-refactor'
373faae Refactor how bundles and frameworks are supported.
2013-06-03 09:56:32 -04:00
Clinton Stimpson 483e208482 OS X: Fix getting of CFBundle LOCATION property.
This fixes bug #13797.
The kinds of changes applied in 373faae5 for frameworks are now
applied to CFBundle.  The prefix and suffix for CFBundles are
now handled in cmTarget::GetFullNameInternal.
2013-06-03 06:29:33 -06:00
Clinton Stimpson 373faae5e1 Refactor how bundles and frameworks are supported.
Make handling of directory separators consistent between
non-bundle and bundle code.

Remove xcode specific flag from cmTarget when getting install_name.

Add (more) consistent convenience functions in cmTarget to get
directories inside of bundles and frameworks to add files to.

This refactor also fixes bug #12263 where frameworks
had the wrong install name when SKIP_BUILD_RPATH.

Also make install_name for frameworks consistent between Makefile
and Xcode generator.
2013-05-23 10:42:49 -04:00
Andreas Mohr bf019d765d Fix spelling and typos (non-binary) 2013-05-07 08:39:19 -04:00
Patrick Gansterer a55d5ca481 Ninja: Avoid LNK1170 linker error
link.exe has problems with very very long lines in rsp files too.
Use $in_newline instead of $in variable for rspcontent which
separates the arguments with a newline instead of a simple space
and was specially made for this purpose.
2013-02-04 16:26:39 -05:00
Peter Kümmel 12ab1354fc Ninja: encode LINK_FLAGS to handle bash variables
Bug 13560
2012-11-20 22:00:09 +01:00
Stephen Kelly bd8bdb6fdd Resolve warnings about unused variables. 2012-11-07 13:45:30 +01:00
Peter Kümmel 1e47ccb554 Ninja: add option to enforce usage of response files
If the cmake or environment variable CMAKE_NINJA_FORCE_RESPONSE_FILE
is set then a response file is used regardless the command line length.
2012-10-01 17:06:38 -04:00
Peter Kümmel e31df03939 Ninja: move <OBJECTS> in front of the first linker option
In the response file also linker options could be passed,
and because <OBJECTS> is replaced by a response file, it
is necessary that no compiler option follows <OBJECTS>.
2012-10-01 17:06:38 -04:00
Peter Kümmel 8d674e7844 Ninja: move -LIBPATH behind -link option
Don' pass linker option to the compile
2012-10-01 17:06:38 -04:00
Peter Kümmel f1670ab18a Ninja: don't confuse ninja's rsp files with nmake's
Move response files into CMakeFiles/ which makes them different to nmake's.
2012-09-28 12:33:57 +02:00
Stephen Kelly f9146f6b90 Port cmLocalGenerator::GetTargetFlags to cmGeneratorTarget. 2012-09-19 15:31:39 +02:00
Stephen Kelly 78bfee35d5 Make cmLocalGenerator::AddArchitectureFlags take a cmGeneratorTarget. 2012-09-19 15:31:29 +02:00
Peter Kümmel 4bb4787780 Ninja:split out setting of msvc TARGET_PDB 2012-08-22 12:37:55 +02:00
Peter Kümmel 59cbc28b92 Ninja: prepare msvc pdb cleanup 2012-08-22 12:26:56 +02:00
David Cole a51e1529e7 Merge topic 'ninja-fix-macosx'
1fc8df9 Add missing this->.
7a3ecf5 Fix memory leak in Makefile generator.
9f7dc83 Ninja: also bootstrap ninja files
5d365b2 Ninja: enable ninja support everywhere
d569f3e Ninja: void function can't return a value
52160bf Ninja: enable ninja on Mac so all Mac CDash-builds are tested, cleanup later
56aeac6 Ninja: fixes for bcc
7a6bc9e Ninja: remove 'this' from member initializer list
44ba4cf Ninja: remove warnings
7751966 Ninja: remove 'friend' in ninja code
c3988ee Re-factor OS X content generator start up.
f8e0a51 Re-factor framework directory computation.
f36c7b0 Re-factor Mac OS X content directory computation.
5d885db Re-factor bundle content copying rules generation.
3b2a01e Ninja: Use same echo message as makefiles.
7bb56c5 Re-factor CFBundle generation.
...
2012-07-24 17:03:46 -04:00
David Cole 0f87f32fe3 Merge topic 'ninja-mingw-TARGET_PDB'
9e30289 Ninja: Cannot pass a reference to an anonymous object.
0a3d6a1 Ninja: make debug symbol suffix configurable by CMAKE_DEBUG_SYMBOL_SUFFIX
75bbffb Ninja: make TARGET_PDB a real .gdb file name
e5a27a4 Ninja: line length
ae8124a Ninja: also mingw needs TARGET_PDB
2012-07-24 17:03:13 -04:00
Nicolas Despres 9e30289176 Ninja: Cannot pass a reference to an anonymous object. 2012-07-18 12:35:10 +02:00
Nicolas Despres 3b2a01e80e Ninja: Use same echo message as makefiles. 2012-07-17 14:03:10 +02:00
Nicolas Despres 7bb56c511e Re-factor CFBundle generation. 2012-07-17 14:03:09 +02:00
Nicolas Despres 54d9713adb Ninja: Add support for CFBundle.
This patch fixes test CFBundleTest on Darwin.
2012-07-17 14:03:08 +02:00
Nicolas Despres 10686a17f4 Ninja: Copy resource files in the bundle.
This patch fixes test BundleTest on Darwin.
2012-07-17 14:03:08 +02:00