Commit Graph

101 Commits

Author SHA1 Message Date
Peter Kümmel f212615d3e Ninja: don't parse empty string 2013-11-04 13:20:27 +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
Brad King 41a2fb5ba0 Merge topic 'tid-system-argument'
9cf3547 Add the INTERFACE_SYSTEM_INCLUDE_DIRECTORIES target property.
1925cff Add a SYSTEM parameter to target_include_directories (#14180)
286f227 Extend the cmTargetPropCommandBase interface property handling.
83498d4 Store system include directories in the cmTarget.
f1fcbe3 Add Target API to determine if an include is a system include.
2679a34 Remove unused variable.
2013-07-16 13:59:07 -04:00
Brad King d5d54b4629 Merge topic 'compile-defs-debugging'
d7dd010 Add target property debugging for COMPILE_DEFINITIONS
1841215 Refactor cmTarget::GetCompileDefinitions to use an out-vector, not a string.
afc9243 Add an overload of cmIDEOptions::AddDefines taking a vector of strings.
d95651e Overload cmLocalGenerator::AppendDefines to add a list.
2013-07-15 09:34:00 -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
Stephen Kelly 184121538c Refactor cmTarget::GetCompileDefinitions to use an out-vector, not a string.
Refactor to create AddCompileDefinitions.
2013-07-11 08:23:56 +02:00
Stephen Kelly f1fcbe3fde Add Target API to determine if an include is a system include.
The implementation can be modified later so that system includes
can be determined on a per-target basis.
2013-07-02 16:40:02 +02:00
Brad King 62428f5e72 Merge topic 'ninja_phony_targets'
539356f Ninja: Custom Command file depends don't need to exist before building
874e171 Ninja: GlobalNinjaGenerator WriteBuild and WritePhonyBuild non static
88d27ad Add a test to expose a bug with add_custom_command and ninja.
2013-07-01 09:15:09 -04: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 d221eac812 Refactor target COMPILE_OPTIONS and COMPILE_FLAGS handling
Replace the cmLocalGenerator GetCompileOptions method with an
AddCompileOptions method since all call sites of the former simply
append the result to a flags string anyway.

Add a "lang" argument to AddCompileOptions and move the
CMAKE_<LANG>_FLAGS_REGEX filter into it.  Move the call sites in each
generator to a location that has both the language and configuration
available.  In the Makefile generator this also moves the flags from
build.make to flags.make where they belong.
2013-06-27 12:57:32 -04: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 ff8917fdd2 Merge topic 'VISIBILITY_PRESET-property'
cd1fa53 Add a COMPILE_OPTION for a VISIBILITY_INLINES_HIDDEN target property.
0e9f4bc Introduce target property <LANG>_VISIBILITY_PRESET
2013-06-05 09:38:59 -04:00
Brad King e57b6a2521 Merge topic 'target-COMPILE_OPTIONS'
24466f2 Add target_compile_options command.
80ca9c4 Add COMPILE_OPTIONS target property.
7cb2308 cmTarget: Rename LinkInterfaceIncludeDirectoriesEntries
47f80d9 cmTarget: Rename struct to be more re-usable.
1319a14 Add <LANG>_COMPILER_ID generator expressions.
3549676 Add cmLocalGenerator::GetCompileOptions.
f3ad863 VS6: Rename some variables to correspond to config values.
2013-06-03 09:57:44 -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
Stephen Kelly 0e9f4bc00c Introduce target property <LANG>_VISIBILITY_PRESET
This is initialized by CMAKE_<LANG>_VISIBILITY_PRESET. The target
property is used as the operand to the -fvisibility= compile option
with GNU compilers and clang.
2013-06-02 12:00:51 +02:00
Stephen Kelly 35496761a5 Add cmLocalGenerator::GetCompileOptions.
Currently it only adds the contents of the COMPILE_FLAGS target
property, but it can be extended to handle a new COMPILE_OPTIONS
generator expression enabled property.
2013-06-02 11:56:36 +02: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
Brad King 87c0d16ab7 Ninja: Fix OBJECT_DIR placeholder path conversion
Transform the path using ConvertToNinjaPath just as we do for all other
paths.  This fixes the OutOfSource test for objects in the ../OutOfBinary
directory by computing the proper full path for the /Fd option.
2013-04-11 10:23:33 -04:00
Stephen Kelly a6286e92c9 Fix the evaluation of per-config COMPILE_DEFINITIONS (#14037)
The API for retrieving per-config COMPILE_DEFINITIONS has long
existed because of the COMPILE_DEFINITIONS_<CONFIG> style
properties. Ensure that the provided configuration being generated
is also used to evaluate the generator expressions
in cmTarget::GetCompileDefinitions.

Both the generic COMPILE_DEFINITIONS and the config-specific
variant need to be evaluated with the requested configuration. This
has the side-effect that the COMPILE_DEFINITIONS does not need to
be additionally evaluated with no configuration, so the callers can
be cleaned up a bit too.
2013-03-25 10:49:22 -04:00
Peter Kümmel bbea30eec8 Ninja: remove implicit dependency on custom command outputs
Revert aa2e1e9cae
With this commit all files are rebuild when only one moc file has changed.

BUG 0013874
2013-02-16 13:45:28 +01:00
Stephen Kelly 0e10782ba7 Move GetCompileDefinitions to cmTarget. 2013-01-29 14:11:49 -05:00
Stephen Kelly 3581b96caa Process the INTERFACE_PIC property from linked dependencies
This allows a dependee to inform a target that it should have its
POSITION_INDEPENDENT_CODE property set to ON, or OFF. The value of
the POSITION_INDEPENDENT_CODE property, if set, must be consistent
with any INTERFACE_POSITION_INDEPENDENT_CODE properties on dependees.

Add a test covering the consistency checks on platforms where they run.
2013-01-10 09:54:52 -05:00
Mathias Gaunard 9fc2e20244 Ninja: fix usage of cldeps with ctest launchers 2012-11-30 03:46:55 +01:00
Stephen Kelly 0bbae6f95f Revert "Move GetLinkInformation to cmGeneratorTarget"
As we can't move all linking related code from cmTarget, it makes
sense to reverse the move in some cases.

This reverts commit 4f5384e75c.
2012-11-21 15:49:37 +01:00
David Cole f3b8049884 Merge topic 'fix-INCLUDE_DIRECTORIES-multiconfig'
2a6bd96 Fix config-specific INCLUDE_DIRECTORIES in multi-config generators
2012-10-17 16:44:53 -04:00
Stephen Kelly 2a6bd96c13 Fix config-specific INCLUDE_DIRECTORIES in multi-config generators
Commit 08cb4fa4 (Process generator expressions in the
INCLUDE_DIRECTORIES property, 2012-09-18) contained an incorrect
assumption that CMAKE_BUILD_TYPE was set on the makefile for each
generated configuration in multi-config generators. Fix that by making
the GetIncludeDirectories API depend on the config.
2012-10-17 16:24:14 -04:00
Brad King f413d280bc Merge topic 'ninja-custom-command-implicit'
aa2e1e9 Ninja: implicit dependency for custom command files
2012-10-09 08:38:54 -04:00
Brad King 7da986bb6c Merge topic 'ninja-dont-pollute-current-dir'
74fc598 Ninja: don't pollute current dir when using gui (#13495)
2012-10-09 08:38:12 -04:00
Peter Kümmel 74fc5983b9 Ninja: don't pollute current dir when using gui (#13495) 2012-10-09 08:30:03 -04:00
Peter Kümmel aa2e1e9cae Ninja: implicit dependency for custom command files 2012-10-03 18:09:49 +02:00
Peter Kümmel 188c73cb74 Ninja: also set OBJECT_DIR when compiling
BUG: 0013510
2012-10-03 17:24:36 +02:00
Brad King 7dce31f3d0 Merge topic 'vs-pdb-output'
2ccca05 Run PDBDirectoryAndName test on MSVC and Intel
efc83b3 Document that PDB_(NAME|OUTPUT_DIRECTORY) are ignored for VS 6
b294457 Verify that PDB_(NAME|OUTPUT_DIRECTORY) are honored in test
3f60dbf Add PDB_OUTPUT_DIRECTORY and PDB_NAME target properties (#10830)
2012-10-01 14:05:11 -04:00
David Cole eaba65e308 Merge topic 'ninja-OBJECT_DEPENDS'
8f0e08d Ninja: OBJECT_DEPENDS should set an implicit dependency
2012-09-28 15:45:11 -04:00
Peter Kümmel 8f0e08d503 Ninja: OBJECT_DEPENDS should set an implicit dependency
BUG 13559
2012-09-25 22:22:55 +02:00
Yuchen Deng 3f60dbf148 Add PDB_OUTPUT_DIRECTORY and PDB_NAME target properties (#10830)
This enables changing the name and output folder of the debug symbol
files produced by MS compilers.

Inspired-by: Thomas Bernard <thomas.bernard@ipetronik.com>
2012-09-25 15:23:35 -04:00
David Cole 3f3b731961 Merge topic 'use-generator-target'
879fd35 Revert "Move GenerateTargetManifest to cmGeneratorTarget."
6674583 Fix compiler warning with initialization order.
5285458 Add convenience for getting a cmGeneratorTarget to use.
c31f3d9 Add a wrapper for accessing config-specific compile-definitions.
d1446ca Append the COMPILE_DEFINITIONS from the Makefile to all targets.
290e92a Move GetIncludeDirectories to cmGeneratorTarget.
f9146f6 Port cmLocalGenerator::GetTargetFlags to cmGeneratorTarget.
9facfd1 Move GetCreateRuleVariable to cmGeneratorTarget.
78bfee3 Make cmLocalGenerator::AddArchitectureFlags take a cmGeneratorTarget.
4f5384e Move GetLinkInformation to cmGeneratorTarget
987e12e Move GenerateTargetManifest to cmGeneratorTarget.
14bf778 Store cmGeneratorTargets with the makefile.
f428ca2 Add more forwarding API to cmGeneratorTarget.
2012-09-25 15:18:34 -04:00
Stephen Kelly c31f3d99f8 Add a wrapper for accessing config-specific compile-definitions. 2012-09-19 15:32:19 +02:00
Stephen Kelly d1446ca7a0 Append the COMPILE_DEFINITIONS from the Makefile to all targets.
This way we don't need to check the definitions from the Makefile when
generating later, and can more easily add generator expressions.

Duplication is not a problem as the definitions are de-duplicated before
generating.
2012-09-19 15:32:13 +02:00
Stephen Kelly 290e92ada8 Move GetIncludeDirectories to cmGeneratorTarget. 2012-09-19 15:32:09 +02:00
Stephen Kelly 78bfee35d5 Make cmLocalGenerator::AddArchitectureFlags take a cmGeneratorTarget. 2012-09-19 15:31:29 +02:00
Stephen Kelly 4f5384e75c Move GetLinkInformation to cmGeneratorTarget 2012-09-19 15:30:57 +02:00
Peter Kümmel a1c9c136c3 Ninja: filter target specific compile flags with language specific regex
sync with Makefile code.

Bug: 13486

Many thanks to Nils Gladitz
2012-09-18 18:02:10 +02:00
Peter Kümmel 7b2bf28e18 Ninja: suppress cmcldeps only for source file signature try_compiles 2012-09-05 14:38:49 +02:00
David Cole ed01420c23 Merge topic 'ninja-target-pdb-cleanup'
709fa59 Ninja: remove GetTargetPDB because it is used only once
4bb4787 Ninja:split out setting of msvc TARGET_PDB
59cbc28 Ninja: prepare msvc pdb cleanup
2012-08-24 14:24:35 -04:00
David Cole 05784dadc5 Merge topic 'compile-definitions-unique'
f0a1065 Rename files from main.cpp to more meaningful names.
ca7fb14 Fix the test setting COMPILE_DEFINITIONS target property
733deb6 Fix CompileDefinitions test on Visual Studio.
3dae652 Don't duplicate -D defines sent to the compiler.
2012-08-24 14:24:24 -04:00
Peter Kümmel 709fa59562 Ninja: remove GetTargetPDB because it is used only once 2012-08-22 14:11:30 +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
Stephen Kelly 3dae652b4e Don't duplicate -D defines sent to the compiler.
There is no need to do so. Be consistent with include directories and
ensure uniqueness.

This requires changing the API of the cmLocalGenerator::AppendDefines
method, and changing the generators to match.

The test unfortunately can't test for uniqueness, but it at least verifies
that nothing gets lost.
2012-08-20 22:30:11 +02:00
Peter Kümmel 4a35bd0e69 Ninja: don't crash on returned 0 pointer 2012-08-17 16:33:59 +02:00