summaryrefslogtreecommitdiffstats
path: root/Source/cmLocalGenerator.cxx
Commit message (Collapse)AuthorAgeFilesLines
* Remove TODO to uniq COMPILE_OPTIONSStephen Kelly2013-07-181-1/+1
| | | | | Compile options should not be passed through a uniq filter because repeated use of an option may have siginificance.
* Merge topic 'drop-old-vs-dependency'Brad King2013-07-161-7/+1
|\ | | | | | | | | 4bb6e24 VS,Xcode: Drop incorrect legacy dependency trace (#14291)
| * VS,Xcode: Drop incorrect legacy dependency trace (#14291)Brad King2013-07-151-7/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Drop the "vsProjectFile" argument from cmTarget::TraceDependencies. It appears to be the modern equivalent to a hunk added in commit ba68f771 (...added new custom command support, 2003-06-03): + name = libName; + name += ".dsp.cmake"; + srcFilesToProcess.push(name); but was broken by refactoring at some point. The current behavior tries to trace dependencies on a source file named the same as a target, which makes no sense. Furthermore, in code of the form add_executable(foo foo.c) add_custom_command(OUTPUT "${somewhere}/foo" ... DEPENDS foo) the "vsProjectFile" value "foo" matches source "${somewhere}/foo.rule" generated to hold the custom command and causes the command to be added to the "foo" target incorrectly. Simply drop the incorrect source file trace and supporting logic.
* | Merge topic 'tid-system-argument'Brad King2013-07-161-4/+4
|\ \ | | | | | | | | | | | | | | | | | | | | | | | | | | | 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.
| * | Add Target API to determine if an include is a system include.Stephen Kelly2013-07-021-3/+4
| | | | | | | | | | | | | | | The implementation can be modified later so that system includes can be determined on a per-target basis.
| * | Remove unused variable.Stephen Kelly2013-07-021-1/+0
| |/
* | Merge topic 'compile-defs-debugging'Brad King2013-07-151-0/+17
|\ \ | | | | | | | | | | | | | | | | | | | | | 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.
| * | Refactor cmTarget::GetCompileDefinitions to use an out-vector, not a string.Stephen Kelly2013-07-111-0/+11
| | | | | | | | | | | | Refactor to create AddCompileDefinitions.
| * | Overload cmLocalGenerator::AppendDefines to add a list.Stephen Kelly2013-07-101-0/+6
| |/
* | Revert "Use --sysroot when cross compiling."Stephen Kelly2013-07-121-5/+1
|/ | | | | | | This reverts commit de4da665d3205afa239749c41513a315c3831f51. This feature is not yet ready for release. It needs to be merged with the CMAKE_OSX_SYSROOT feature.
* Refactor target COMPILE_OPTIONS and COMPILE_FLAGS handlingBrad King2013-06-271-12/+40
| | | | | | | | | | | | 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.
* Escape target flags taken from COMPILE_OPTIONSBrad King2013-06-271-3/+10
| | | | | | | | | | | | Factor appending of individual flags out into an AppendFlagEscape method in cmLocalGenerator and teach it to use EscapeForShell. Update all COMPILE_OPTIONS handling to use AppendFlagEscape. Override the method in the Xcode generator to use its custom escape implementation. Teach the CompileOptions test to add an option that requires escaping everywhere instead of just with the GNU tools.
* Merge topic 'COMPILER_TARGET'Brad King2013-06-261-0/+14
|\ | | | | | | | | 2d9ec1d Add compiler target compile options.
| * Add compiler target compile options.Stephen Kelly2013-06-111-0/+14
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | For clang, this allows passing -target <triple> to the compiler, and for qcc, -V<arch> using toolchain files containing something like set(triple arm-linux-gnueabihf) set(CMAKE_C_COMPILER "/usr/bin/clang") set(CMAKE_C_COMPILER_TARGET ${triple}) set(CMAKE_CXX_COMPILER "/usr/bin/clang++") set(CMAKE_CXX_COMPILER_TARGET ${triple}) or set(arch gcc_ntoarmv7le) set(CMAKE_C_COMPILER /opt/qnx650/host/linux/x86/usr/bin/qcc) set(CMAKE_C_COMPILER_TARGET ${arch}) set(CMAKE_CXX_COMPILER /opt/qnx650/host/linux/x86/usr/bin/QCC) set(CMAKE_CXX_COMPILER_TARGET ${arch}) Both clang and qcc are inherently cross compiler( driver)s.
* | Merge topic 'set-sysroot'Brad King2013-06-241-1/+5
|\ \ | | | | | | | | | | | | de4da66 Use --sysroot when cross compiling.
| * | Use --sysroot when cross compiling.Stephen Kelly2013-06-071-1/+5
| |/ | | | | | | | | | | | | | | | | | | 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.
* | Add whitespace after colons in error messages.Stephen Kelly2013-06-211-2/+2
|/
* Merge topic 'VISIBILITY_PRESET-property'Brad King2013-06-051-0/+75
|\ | | | | | | | | | | cd1fa53 Add a COMPILE_OPTION for a VISIBILITY_INLINES_HIDDEN target property. 0e9f4bc Introduce target property <LANG>_VISIBILITY_PRESET
| * Add a COMPILE_OPTION for a VISIBILITY_INLINES_HIDDEN target property.Stephen Kelly2013-06-021-20/+47
| | | | | | | | | | | | | | This corresponds to the g++ and clang++ option -fvisibility-inlines-hidden on linux. On Windows with MinGW, this corresponds to -fno-keep-inline-dllexport. That option is not supported by clang currently.
| * Introduce target property <LANG>_VISIBILITY_PRESETStephen Kelly2013-06-021-0/+48
| | | | | | | | | | | | 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.
* | Add COMPILE_OPTIONS target property.Stephen Kelly2013-06-021-0/+8
| | | | | | | | | | | | This method reads generator expressions from the COMPILE_OPTIONS target property, as well as INTERFACE_COMPILE_OPTIONS from linked dependents.
* | Add cmLocalGenerator::GetCompileOptions.Stephen Kelly2013-06-021-0/+12
|/ | | | | | 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.
* Merge topic 'unused-cleanup'Brad King2013-05-211-2/+0
|\ | | | | | | | | | | | | 994dc70 Remove unused vector population. 44258cc Remove unused typedef. 0a4d7d8 Remove unused marker for a variable which is now used.
| * Remove unused vector population.Stephen Kelly2013-05-201-2/+0
| | | | | | | | The call to GetEnabledLanguages does not have side-effects.
* | Merge topic 'fix-style'Brad King2013-05-211-2/+2
|\ \ | | | | | | | | | | | | | | | 3c7c332 Fix brace indentation. c70b9b5 Fix style.
| * | Fix brace indentation.Stephen Kelly2013-05-181-2/+2
| |/
* | Fix spelling and typos (affecting binary data / module messages)Andreas Mohr2013-05-071-1/+1
|/
* Automoc: append implicit includes after user-specified dirsStephen Kelly2013-03-191-13/+24
| | | | | | | | | | | | | | | | | | | | | The commit d2536579 (Automoc: fix regression #13667, broken build in phonon, 2012-11-19) changed Automoc to try to re-add the Qt header dir if it was stripped out as an implicit include from the moc command line. When invoking a compiler, those directories are stripped out because they are built-in, but for moc, there are no built-in directories. The follow-up commit acc22400 (Automoc: get include dirs without stripping implicit include dirs off, 2012-12-07) went further by not removing the implicit include dirs, if they were specified specifically by the user. This had the remaining problem that the implicit include dirs appeared in a different order of precedence for moc compared to the compiler. Resolve that by stripping out the include dirs, where specified for the moc command line to, and then appending them at the end. Note that the order of the appended implicit include directories is the order they are specified in the CMAKE_CXX_IMPLICIT_INCLUDE_DIRECTORIES, not the order specified by the user.
* Process generator expressions for 'system' include directories.Stephen Kelly2013-02-071-2/+3
| | | | | | | | | | Since commit 08cb4fa4 (Process generator expressions in the INCLUDE_DIRECTORIES property., 2012-09-18), it is possible to use generator expressions with the include_directories command. As that command can also have a SYSTEM argument, ensure that the result of using that argument with generator expressions gives a sane result.
* Process the INTERFACE_PIC property from linked dependenciesStephen Kelly2013-01-101-3/+14
| | | | | | | | | 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.
* OS X: Link with all framework search paths, not just the lastBrad King2012-12-111-1/+1
| | | | | | | | Refactoring in commit 8d674e78 (Ninja: move -LIBPATH behind -link option, 2012-09-26) accidentally added code that overwrites the framework search path flags on each iteration instead of appending. Change '=' to '+=' to fix it. This affects Makefile and Ninja generators.
* Automoc: get include dirs without stripping implicit include dirs offAlex Neundorf2012-12-071-11/+16
| | | | | | | | | This should finally fix #13667 and #13762. Instead of adding special handling to guess whether implicit include dirs may have been removed, simply make it possible to query the include dirs without removing the implicit ones. Alex
* Merge topic 'revert-use-generator-target'Brad King2012-11-271-1/+1
|\ | | | | | | | | | | | | 0bbae6f Revert "Move GetLinkInformation to cmGeneratorTarget" d5cf644 Split link information processing into two steps. d8a59ea Port cmGeneratorExpression to cmTarget from cmGeneratorTarget.
| * Revert "Move GetLinkInformation to cmGeneratorTarget"Stephen Kelly2012-11-211-1/+1
| | | | | | | | | | | | | | As we can't move all linking related code from cmTarget, it makes sense to reverse the move in some cases. This reverts commit 4f5384e75c6a00d110d3fa3f555a3f6a4f31bb46.
* | NMake: Fix problem with empty DEPENDS args (#13392)David Cole2012-11-211-0/+8
|/ | | | | | | | | | | | | add_custom_command can have empty DEPENDS arguments, which was triggering invalid makefile generation for the NMake Makefiles generator. We were mistakenly emitting the build directory appended with "/" plus the empty string... which was then translated to a string ending in \" in build.make... which nmake choked on. The solution is not to emit any dependency when the input DEPENDS is the empty string. Return early from GetRealDependency in this empty input case.
* GenEx: Create cmGeneratorTargets for imported targets.Stephen Kelly2012-10-221-0/+4
| | | | | | | | | | | | | We're going to need to link to them, and all the linking API is moving to cmGeneratorTarget. Skip imported targets when iterating over cmGeneratorTargets in places where we only want targets we build. The GetGeneratorTargets result now includes IMPORTED targets where it didn't before. The GetTargets result, which was what used to be called in these methods does not include IMPORTED targets. This doesn't relate to any known bugs, but in some future uses of GetGeneratorTargets it will be important, so starting the convention and being deliberate now is a good idea.
* Fix config-specific INCLUDE_DIRECTORIES in multi-config generatorsStephen Kelly2012-10-171-2/+3
| | | | | | | | 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.
* Merge topic 'ninja-LIBPATH'Brad King2012-10-021-16/+25
|\ | | | | | | | | | | | | 1e47ccb Ninja: add option to enforce usage of response files e31df03 Ninja: move <OBJECTS> in front of the first linker option 8d674e7 Ninja: move -LIBPATH behind -link option
| * Ninja: move -LIBPATH behind -link optionPeter Kümmel2012-10-011-16/+25
| | | | | | | | Don' pass linker option to the compile
* | Merge topic 'generator-expression-target-properties'Brad King2012-09-281-4/+7
|\ \ | |/ |/| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 083de7e Process generator expressions in the COMPILE_DEFINITIONS target property. 08cb4fa Process generator expressions in the INCLUDE_DIRECTORIES property. 0ef091d Early return if there is no target. eb250cd Add a self-reference check for target properties. 7e80747 Add API to check that dependent target properties form a DAG. 239ac84 Add a generator expression for target properties. e028381 Extend the generator expression language with more logic. b8e61d6 Refactor GetCompileDefinitions a bit. 2c2b25b Return a std::string from GetCompileDefinitions. b7e48e0 Add an AppendDefines std::string overload. 9a16087 Convert paths in INCLUDE_DIRECTORIES property to Unix slashes. 4557c8d Don't prepend a path before generator expressions in include_directories. c6abc41 Add include guard for cmGeneratorExpression. 0ff4e3f Port remaining code to GetCompileDefinitions(). f178d53 Fix indentation in the code blocks generator.
| * Early return if there is no target.Stephen Kelly2012-09-281-4/+7
| | | | | | | | | | | | The remainder of this method depends on the target existing (otherwise the includes container would be empty), so make the code a little more readable.
* | Merge topic 'use-generator-target'David Cole2012-09-251-31/+32
|\ \ | |/ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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.
| * Revert "Move GenerateTargetManifest to cmGeneratorTarget."Stephen Kelly2012-09-201-4/+3
| | | | | | | | | | | | | | | | This reverts commit 987e12e2f962b6e9ed9f15f8ff486512911b744e. GenerateTargetManifest is called by the global generator before it creates the generator targets, so we can't move it to cmGeneratorTarget yet.
| * Move GetIncludeDirectories to cmGeneratorTarget.Stephen Kelly2012-09-191-2/+2
| |
| * Port cmLocalGenerator::GetTargetFlags to cmGeneratorTarget.Stephen Kelly2012-09-191-20/+19
| |
| * Move GetCreateRuleVariable to cmGeneratorTarget.Stephen Kelly2012-09-191-1/+1
| |
| * Make cmLocalGenerator::AddArchitectureFlags take a cmGeneratorTarget.Stephen Kelly2012-09-191-16/+17
| |
| * Move GetLinkInformation to cmGeneratorTargetStephen Kelly2012-09-191-2/+3
| |
| * Move GenerateTargetManifest to cmGeneratorTarget.Stephen Kelly2012-09-191-3/+4
| |
* | OS X: Always generate -isysroot if any SDK is in useBrad King2012-09-211-29/+17
|/ | | | | | | | Drop the last use of CMAKE_OSX_SYSROOT_DEFAULT. Replace internal platform variable CMAKE_${lang}_HAS_ISYSROOT with a more general CMAKE_${lang}_SYSROOT_FLAG variable. If the -isysroot flag exists and CMAKE_OSX_SYSROOT points to an SDK (not "/") then always add it to compiler command lines. This is already done in the Xcode IDE.