summaryrefslogtreecommitdiffstats
path: root/Source/cmGeneratorTarget.cxx
Commit message (Collapse)AuthorAgeFilesLines
* Apple: Add support for static frameworksGregor Jasny2017-01-311-1/+2
| | | | Closes: #16432
* Xcode: Control emission of EFFECTIVE_PLATFORM_NAMEGregor Jasny2017-01-201-2/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | When building with multiple SDKs within one project Xcode requires the usage of ${EFFECTIVE_PLATFORM_NAME} to put temporary and build outout into separate directories. For example an iOS device and simulator build use two different SDKs (iphoneos and iphonesimulator). In the past cmake tries to detect embedded toolchains that could possibly use simulators and emitted EFFECTIVE_PLATFORM_NAME (EPN) at the proper locations. In #16253 Mark noticed that if he uses macosx and iphoneos in combination the necessary EPN is not emitted. This is because CMake by default assumes macosx SDK which does not trigger EPN emission. The fist naive approach - enabling EPN unconditionally revealed that then the EPN leaks into generator expressions like $<TARGET_FILE:xxx> which might be a regression and thus is unacceptable. The next approach was to add an CMake property to enable EPN emission unconditionally. This solved the reported problem. But the EPN leakage also happened for the embedded toolchains already without anyone noticing. So the control property was turned into a tri-state one: * No definition: EPN is activated for embedded toolchains like before * ON: EPN is always emitted * OFF: EPN is never emitted That approach gives the user the chance to disable EPN for embedded toolchains and restores generator expression functionality for those. Closes: #16253
* clang-tidy: apply modernize-use-bool-literals fixesDaniel Pfeifer2016-12-121-6/+7
|
* cmGeneratorTarget: Add AddIncludeDirectory method (experimental)Sebastian Holtermann2016-12-071-0/+15
|
* Merge topic 'imported-interface-libname'Brad King2016-11-091-0/+13
|\ | | | | | | | | | | | | | | 09cda9d5 Allow imported INTERFACE libraries to specify a link library name 1d1f1eeb cmTarget: Refactor GetMappedConfig to choose location property up front 479932fa cmTarget: Add comment clarifying interface library special case 925e4270 cmTarget: Clarify comments in GetMappedConfig
| * Allow imported INTERFACE libraries to specify a link library nameBrad King2016-11-091-0/+13
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Add an `IMPORTED_LIBNAME[_<CONFIG>]` target property to specify a library name to be placed on the link line in place of an interface library since it has no library file of its own. Restrict use of the property to imported `INTERFACE` libraries. This will be particularly useful for find modules that need to provide imported libraries from system SDKs where the full path to the library file is not known. Now such find modules will be able to provide an imported interface library and set `IMPORTED_LIBNAME` to refer to the SDK library by name. Issue: #15267
* | Merge topic 'include-what-you-use'Brad King2016-11-081-10/+12
|\ \ | | | | | | | | | | | | 2e620f0b Fix several include-what-you-use findings
| * | Fix several include-what-you-use findingsDaniel Pfeifer2016-11-081-10/+12
| |/
* | cmGeneratorTarget: Correctly set FortranModuleDirectoryCreatedDaniel Pfeifer2016-11-051-0/+1
| |
* | cmGeneratorTarget: Don't assing a bool to a stringDaniel Pfeifer2016-11-051-1/+0
|/
* Introduce CM_UNORDERED_SETDaniel Pfeifer2016-10-241-27/+22
| | | | | Avoid duplicating switch among std::unordered_set, cmsys::hash_set, and std::set.
* Merge topic 'clang-tidy'Brad King2016-10-201-1/+1
|\ | | | | | | | | | | effa6c83 fix more issues reported by clang-tidy fb461cac silence selected clang-tidy violations
| * fix more issues reported by clang-tidyDaniel Pfeifer2016-10-201-1/+1
| |
* | cmListFileCache: Remove cmState header includeStephen Kelly2016-10-191-0/+1
| | | | | | | | | | Include it in dependents which have previously relied on it transitively.
* | cmState: Move TargetType enum to separate namespaceStephen Kelly2016-10-191-94/+95
|/
* Merge topic 'extract-computed-target-properties'Brad King2016-10-171-1/+56
|\ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | cef59bb8 cmTarget: Implement GetProperty in terms of cmState::Snapshot 0d57b07a cmTarget: Group code for checking written properties together c3fb0d95 cmTarget: Move sanity checks and computed property access to callers fa9dbc56 cmGeneratorTarget: Implement cmTargetPropertyComputer interface 848ae2a6 cmTargetPropertyComputer: Template some methods on the Target a0a720e6 cm{,Generator}Target: Add global generator accessors 637e3f3e cmTargetPropertyComputer: Unify whitelist handling from cmTarget 05251e6d cmTargetPropertyComputer: Move whitelist check from cmTarget fbf1721c cmTargetPropertyComputer: Extract into new files 390a7d86 cmTargetPropertyComputer: Implement GetProperty without cmMakefile e32a6bdd cmListFileBacktrace: Add a method to retrieve the Bottom of a snapshot 7863fba1 cmTarget: Extract GetLocation method 8096682e cmTarget: Extract GetSources method 7d57c1a2 cmTarget: Extract location computation methods a55cac4b cmTarget: Split property computation into separate class 705fcf52 cmTarget: Move IMPORTED check to callers ...
| * cmTarget: Move sanity checks and computed property access to callersStephen Kelly2016-10-161-0/+12
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The GetProperty method is now just accessing contained data, meaning it can be implemented in cmState. Remove the cmMakefile context from the signature as a result and remove the overload with the same signature. Add a GetComputedProperty to cmTarget so that templates can be properly instantiated. Otherwise the Commands would need to be able to reach the specializations which are currently in cmTarget.cxx. As a side-effect, the CMP0026 warning now gives a backtrace to the target when issued from a generator expression.
| * cmGeneratorTarget: Implement cmTargetPropertyComputer interfaceStephen Kelly2016-10-151-0/+38
| | | | | | | | | | | | | | | | | | Populate a local member for the sources property when the instance is created. Pass the parameter to avoid the policy check when doing so. Ordinarily, the GetSources function should not be called unconditionally (at generate time), but we need to do so here in case the property is read in a generator expression. The intent is to be able to implement cmGeneratorTarget without requiring cmTarget.
| * cm{,Generator}Target: Add global generator accessorsStephen Kelly2016-10-151-0/+5
| | | | | | | | | | Provide 'static polymorphism' between the types in this aspect so that they can be used indiscriminately in a C++ template.
| * cmTarget: Remove mutable marker from propertiesStephen Kelly2016-10-151-1/+1
| |
* | Factor IDE folder name retrieval out into helper methodGregor Jasny2016-10-171-0/+16
|/ | | | | | Add a `cmGeneratorTarget::GetEffectiveFolderName` helper to abstract lookup of the `FOLDER` property in combination with checking for generator support of folders.
* Add a BUILD_RPATH target property specifying build-tree RPATH entriesRuslan Baratov2016-10-031-0/+3
| | | | | | Users may need to add custom `RPATH` entries to be able to run binaries from their build tree without setting `LD_LIBRARY_PATH`. Provide a way to do this that does not affect the install-tree `RPATH`.
* Simplify CMake per-source license noticesBrad King2016-09-271-11/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | Per-source copyright/license notice headers that spell out copyright holder names and years are hard to maintain and often out-of-date or plain wrong. Precise contributor information is already maintained automatically by the version control tool. Ultimately it is the receiver of a file who is responsible for determining its licensing status, and per-source notices are merely a convenience. Therefore it is simpler and more accurate for each source to have a generic notice of the license name and references to more detailed information on copyright holders and full license terms. Our `Copyright.txt` file now contains a list of Contributors whose names appeared source-level copyright notices. It also references version control history for more precise information. Therefore we no longer need to spell out the list of Contributors in each source file notice. Replace CMake per-source copyright/license notice headers with a short description of the license and links to `Copyright.txt` and online information available from "https://cmake.org/licensing". The online URL also handles cases of modules being copied out of our source into other projects, so we can drop our notices about replacing links with full license text. Run the `Utilities/Scripts/filter-notices.bash` script to perform the majority of the replacements mechanically. Manually fix up shebang lines and trailing newlines in a few files. Manually update the notices in a few files that the script does not handle.
* Fortran: Use module dir flag if needed for default module directoryBrad King2016-09-201-3/+12
| | | | | | | | | | | | | | Our buildsystem model says that the default Fortran module output directory is the build tree directory corresponding to the source tree `CMakeLists.txt` file adding the current target. Extend `cmGeneratorTarget::GetFortranModuleDirectory` to allow generators to pass in the compiler working directory. If the working directory does not match the default Fortran module output directory then we need an explicit module directory flag (e.g. `-J`) to tell the compiler to put/use modules in the latter. This does not affect the Makefile generator but will be useful for future introduction of Fortran support to the Ninja generator.
* cmGeneratorTarget: Refactor Fortran module directory lookupBrad King2016-09-201-2/+5
| | | | Make `target_module_dir` and owned value so we can modify it.
* ninja: error out on relink requirementsBen Boeckel2016-09-151-1/+22
| | | | | | | | Ninja does not support PRE_INSTALL_SCRIPT properties and does not perform the relink required by installation without help from some other mechanism, so error out if it would be required. Issue: #13934, #16304
* cmGeneratorTarget: factor out a spaceBen Boeckel2016-09-131-3/+3
|
* cmGeneratorTarget: factor out common part of AddSources commandsDaniel Pfeifer2016-09-081-11/+8
|
* cmGeneratorTarget: use erase-unique instead of reinitializationDaniel Pfeifer2016-09-081-8/+4
| | | | | Just to make it easier to find places where containers are cleared in order to be recomputed.
* cmGeneratorTarget: don't clear container in destructorDaniel Pfeifer2016-09-081-1/+0
| | | | | It will be destroyed anyway. This also makes it easier to search for places where containers are atually cleared in order to be recomputed.
* fix a load of include-what-you-use violationsDaniel Pfeifer2016-09-031-3/+17
|
* CMake: don't use else after returnDaniel Pfeifer2016-08-181-46/+37
|
* Make sure unnused parameters are /*named*/Daniel Pfeifer2016-08-161-8/+11
|
* Honor BUNDLE_EXTENSION also for Frameworks (#14742)Gregor Jasny2016-07-221-2/+13
|
* Honor BUNDLE_EXTENSION also for App Bundles (#16148)Gregor Jasny2016-07-221-1/+6
|
* Avoid using KWSys auto_ptr by adopting it ourselvesBrad King2016-06-291-16/+14
| | | | | | | | | | | | Replace use of cmsys::auto_ptr with a CM_AUTO_PTR macro that maps to our own implementation adopted from the KWSys auto_ptr implementation. Later we may be able to map CM_AUTO_PTR to std::auto_ptr on compilers that do not warn about it. Automate the client site conversions: git grep -l auto_ptr -- Source/ | grep -v Source/kwsys/ | xargs sed -i \ 's|cmsys::auto_ptr|CM_AUTO_PTR|;s|cmsys/auto_ptr.hxx|cm_auto_ptr.hxx|'
* use CM_NULLPTRDaniel Pfeifer2016-06-281-67/+70
|
* Use <unordered_set> where availableDaniel Pfeifer2016-06-271-1/+4
|
* cmGeneratorTarget: Fix Fortran module directory regressionBrad King2016-06-211-1/+1
| | | | | | Refactoring in commit 49f10f0d (cmGeneratorTarget: Adopt Fortran module directory generation, 2016-06-10) accidentally made a local variable declared `static` causing results to be re-used incorrectly.
* cmGeneratorTarget: Adopt Fortran module directory generationTobias Hunger2016-06-171-0/+35
| | | | | | | | | Move code to create/get the fortran module directory from the cmCommonTargetGenerator to cmGeneratorTarget. Rename the ComputeFortranModuleDirectory method to CreateFortranModuleDirectory as this method *creates* the directory if it is missing.
* Prefer istringstream and ostringstream over stringstream.Daniel Pfeifer2016-06-141-2/+2
| | | | Use istringsream for parsing, ostringstream for generation.
* Add missing braces around statements.Daniel Pfeifer2016-06-101-7/+14
| | | | | Apply fixits of clang-tidy's readability-braces-around-statements checker.
* Simplify boolean expressionsDaniel Pfeifer2016-06-021-5/+1
| | | | | | Use clang-tidy's readability-simplify-boolean-expr checker. After applying the fix-its, revise all changes *very* carefully. Be aware of false positives and invalid changes.
* Merge topic 'improve-character-find-and-replace'Brad King2016-05-251-1/+1
|\ | | | | | | | | | | | | | | 5784747d Improve string find: prefer character overloads. 5cec953e Use std::replace for replacing chars in strings. 2a1a2033 cmExtraEclipseCDT4Generator: use std::replace. 34bc6e1f cmCTestScriptHandler: don't call find repeatedly.
| * Improve string find: prefer character overloads.Daniel Pfeifer2016-05-241-1/+1
| | | | | | | | | | Apply fix-its from clang-tidy's performance-faster-string-find checker. Ignore findings in kwsys.
* | Add a variable to specify language-wide system include directoriesBrad King2016-05-251-0/+12
|/ | | | | | | Create a `CMAKE_<LANG>_STANDARD_INCLUDE_DIRECTORIES` variable to specify system include directories for for `<LANG>` compiler command lines. This plays a role for include directories as the existing `CMAKE_<LANG>_STANDARD_LIBRARIES` variable does for link libraries.
* Revise C++ coding style using clang-formatKitware Robot2016-05-161-2741/+1907
| | | | | | | | | | | | | Run the `Utilities/Scripts/clang-format.bash` script to update all our C++ code to a new style defined by `.clang-format`. Use `clang-format` version 3.8. * If you reached this commit for a line in `git blame`, re-run the blame operation starting at the parent of this commit to see older history for the content. * See the parent commit for instructions to rebase a change across this style transition commit.
* cmGeneratorTarget: Protect macro code layout from clang-formatBrad King2016-05-161-12/+12
| | | | | | | The `IMPLEMENT_VISIT_IMPL` macro must preserve a space before the `>` character in case the `DATATYPE` is a template type ending in `>`. Manually format the macro layout as clang-format would except for this space. Then add markup to tell clang-format not to format this macro.
* Remove `//------...` horizontal separator commentsBrad King2016-05-091-169/+0
| | | | | | | | | | | | | | | | | | | | | | | | Modern editors provide plenty of ways to visually separate functions. Drop the explicit comments that previously served this purpose. Use the following command to automate the change: $ git ls-files -z -- \ "*.c" "*.cc" "*.cpp" "*.cxx" "*.h" "*.hh" "*.hpp" "*.hxx" | egrep -z -v "^Source/cmCommandArgumentLexer\." | egrep -z -v "^Source/cmCommandArgumentParser(\.y|\.cxx|Tokens\.h)" | egrep -z -v "^Source/cmDependsJavaLexer\." | egrep -z -v "^Source/cmDependsJavaParser(\.y|\.cxx|Tokens\.h)" | egrep -z -v "^Source/cmExprLexer\." | egrep -z -v "^Source/cmExprParser(\.y|\.cxx|Tokens\.h)" | egrep -z -v "^Source/cmFortranLexer\." | egrep -z -v "^Source/cmFortranParser(\.y|\.cxx|Tokens\.h)" | egrep -z -v "^Source/cmListFileLexer\." | egrep -z -v "^Source/cm_sha2" | egrep -z -v "^Source/(kwsys|CursesDialog/form)/" | egrep -z -v "^Utilities/(KW|cm).*/" | xargs -0 sed -i '/^\(\/\/---*\|\/\*---*\*\/\)$/ {d;}' This avoids modifying third-party sources and generated sources.
* Isolate formatted streaming blocks with clang-format off/onBrad King2016-05-061-0/+10
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The clang-format tool can do a good job formatting most code, but well-organized streaming blocks are best left manually formatted. Find blocks of the form os << "...\n" "...\n" ; using the command $ git ls-files -z -- Source | egrep -v -z '^Source/kwsys/' | xargs -0 pcregrep -M --color=always -B 1 -A 1 -n \ '<<[^\n]*\n(^ *("[^\n]*("|<<|;)$|;)\n){2,}' Find blocks of the form os << "...\n" << "...\n" << "...\n"; using the command $ git ls-files -z -- Source | egrep -v -z '^Source/kwsys/' | xargs -0 pcregrep -M --color=always -B 1 -A 1 -n \ '<<[^\n]*\n(^ *<<[^\n]*(\\n"|<<|;)$\n){2,}' Surround such blocks with the pair /* clang-format off */ ... /* clang-format on */ in order to protect them from update by clang-format. Use the C-style `/*...*/` comments instead of C++-style `//...` comments in order to prevent them from ever being swallowed by re-formatting of surrounding comments.