summaryrefslogtreecommitdiffstats
path: root/Source/cmMakefileLibraryTargetGenerator.cxx
Commit message (Collapse)AuthorAgeFilesLines
* LocalGenerator: Add a string overload for AppendFlagsBen Boeckel2014-05-071-2/+2
|
* Watcom: Use single quote for all file/path items in wlink commandJiri Malak2014-04-081-4/+10
| | | | | | Watcom Linker use single quote if necessary for quoting target name, libraries names and libraries search path. Object names were already fixed.
* Makefile: Generate single-quoted object lists for WatcomJiri Malak2014-03-271-1/+4
| | | | | | | | | | | | | | | | Drop the CMAKE_NO_QUOTED_OBJECTS internal variable from the Makefile generators. The underlying problem is with the Watcom linker, not with WMake. The Watcom linker wants object files to be single-quoted. Add <LINK-RULE>_USE_WATCOM_QUOTE platform information variables to tell the generators to use Watcom-style single quotes for object files on link lines. On Windows, Watcom uses the GetCommandLine API to get the original command-line string and do custom parsing that expects single quotes. On POSIX systems, Watcom approximates the original command line by joining all argv[] entries separated by a single space. Therefore we need to double-quote the single-quoted arguments so that the shell does not consume them and they are available for the parser to see.
* Remove some c_str() calls.Stephen Kelly2014-03-111-30/+30
| | | | | | 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.
* stringapi: Use strings in target nameBen Boeckel2014-03-081-2/+2
|
* stringapi: Use strings for the languagesBen Boeckel2014-03-081-24/+12
|
* stringapi: Use strings for variable namesBen Boeckel2014-03-081-2/+2
| | | | Variable names are always generated by CMake and should never be NULL.
* Windows: Use response files to specify link libraries for GNU toolsBrad King2014-03-051-1/+13
| | | | | | | | | Work around the command-line-length limit by using an @linklibs.rsp response file to pass the flags for link libraries. This allows very long lists of libraries to be used in addition to the existing support for passing object files via response file. Suggested-by: Peter Keuschnigg <peter.keuschnigg@pmu.ac.at>
* Makefile: Rename linker response file boolean to be more specificBrad King2014-03-051-5/+5
| | | | | Rename local variable useResponseFile to useResponseFileForObjects when it represents CMAKE_<LANG>_USE_RESPONSE_FILE_FOR_OBJECTS.
* Makefile: Factor out some duplicate link libraries generationBrad King2014-03-041-6/+1
| | | | | | | The generators for executable and library targets duplicate the logic to call the OutputLinkLibraries helper on the local generator. Factor it out into a cmMakefileTargetGenerator::CreateLinkLibs method to avoid dpulication.
* MSVC: Add properties to configure compiler PDB files (#14762)Brad King2014-02-261-0/+4
| | | | | | | | | | Since commit v2.8.12~437^2~2 (VS: Separate compiler and linker PDB files 2013-04-05) we no longer set /Fd with the PDB_NAME or PDB_OUTPUT_DIRECTORY properties. Those properties now exclusively handle linker PDB files. Since STATIC libraries do not link their compiler PDB file becomes more important. Add new target properties "COMPILE_PDB_NAME[_<CONFIG>]" and "COMPILE_PDB_OUTPUT_DIRECTORY[_<CONFIG>]" to specify the compiler PDB file location and pass the value to the MSVC /Fd option.
* Makefile: Fix per-config linker PDB output directoryBrad King2014-02-241-1/+1
| | | | | | Also, now that all call sites of cmTarget::GetPDBName and cmTarget::GetPDBDirectory pass the configuration, make the argument non-optional.
* Merge topic 'fix-compile-OBJECT_DIR'Brad King2014-01-021-7/+5
|\ | | | | | | | | 03f3b4e Replace <OBJECT_DIR> rule placeholder consistently (#14667)
| * Replace <OBJECT_DIR> rule placeholder consistently (#14667)Brad King2014-01-021-7/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The <OBJECT_DIR> placeholder is supposed to be the base intermediate files directory for the current target. This is how it gets replaced during link line generation. However, during compile line generation we replace it with the directory containing the current object file which may be a subdirectory. Fix replacement of <OBJECT_DIR> in the generated compile lines to be the base intermediate files directory. This was expoxed by commit 42ba1b08 (VS: Separate compiler and linker PDB files, 2013-04-05) when we added a "/Fd<OBJECT_DIR>/" flag to the MSVC compile line in order to match the VS IDE default compiler program database location in the intermediate files directory. For source files in a subdirectory relative to the current target this caused the wrong location to be used for the compiler program database. This becomes particularly important when using precompiled headers. While at it, use the cmTarget::GetSupportDirectory method to compute the intermediate files directory for the current target instead of repeating the logic in a few places.
* | Remove INTERFACE build targets.Stephen Kelly2013-12-101-3/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Commit b04f3b9a (Create make rules for INTERFACE_LIBRARY targets., 2013-08-21) extended the makefile generator to create build targets for INTERFACE_LIBRARY targets. No other generators were extended with this feature. This conflicts with the feature of whitelisting of target properties read from INTERFACE_LIBRARY targets. The INTERFACE_* properties of the INTERFACE_LIBRARY may legitimately contain TARGET_PROPERTY generator expressions for reading properties from the 'head target'. The 'head target' would be the INTERFACE_LIBRARY itself when creating the build rules for it, which means that non-whitelisted properties would be read.
* | INTERFACE_LIBRARY: Avoid codepaths which set unneeded properties.Stephen Kelly2013-11-251-3/+6
| | | | | | | | | | | | | | | | | | | | | | | | | | As an INTERFACE_LIBRARY has no direct link dependencies, we can short-circuit in cmGeneratorExpressionEvaluator and in cmGlobalGenerator::CheckLocalGenerators. As they do not generate any output directly, any generate- or install- related code acn also be short-circuited. Many of the local generators already do this. Because only INTERFACE related properties make sense on INTERFACE_LIBRARY targets, avoid setting other properties, for example via defaults.
* | Port some of the generator API to cmGeneratorTarget.Stephen Kelly2013-11-221-3/+3
| | | | | | | | | | | | | | Just enough to reach the BuildMacContentDirectory method and the NeedRelinkBeforeInstall methods. In the future, those methods can be moved to cmGeneratorTarget.
* | Create make rules for INTERFACE_LIBRARY targets.Stephen Kelly2013-10-211-0/+3
|/ | | | | | | | | | | | | | | | | | | | | | | | | | | | The result is that the depends of the target are created. So, add_library(somelib foo.cpp) add_library(anotherlib EXCLUDE_FROM_ALL foo.cpp) add_library(extra EXCLUDE_FROM_ALL foo.cpp) target_link_libraries(anotherlib extra) add_library(iface INTERFACE) target_link_libraries(iface INTERFACE anotherlib) Executing 'make iface' will result in the anotherlib and extra targets being made. Adding a regular executable to the INTERFACE of an INTERFACE_LIBRARY will not result in the executable being built with 'make iface' because of the logic in cmComputeTargetDepends::AddTargetDepend. So far, this is implemented only for the Makefile generator. Other generators will follow if this feature is possible for them. Make INTERFACE_LIBRARY targets part of the all target by default. Test this by building the all target and making the expected library EXCLUDE_FROM_ALL.
* Unify the way the flags of a static library are readPatrick Gansterer2013-07-311-6/+2
| | | | | Introduce cmLocalGenerator::GetStaticLibraryFlags() to have a central function for getting the linker flags for a given target.
* Revert "Use --sysroot when cross compiling."Stephen Kelly2013-07-121-20/+0
| | | | | | | This reverts commit de4da665d3205afa239749c41513a315c3831f51. This feature is not yet ready for release. It needs to be merged with the CMAKE_OSX_SYSROOT feature.
* Use --sysroot when cross compiling.Stephen Kelly2013-06-071-0/+20
| | | | | | | | | | 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.
* OS X: Fix getting of CFBundle LOCATION property.Clinton Stimpson2013-06-031-2/+0
| | | | | | | 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.
* Refactor how bundles and frameworks are supported.Clinton Stimpson2013-05-231-7/+6
| | | | | | | | | | | | | | | | 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.
* Always use the auto_ptr from cmsys.Stephen Kelly2012-11-201-2/+0
| | | | | | This is for consistency throughout cmake. The cmsys version exists becaues uses of auto_ptr types as return types does not work with some implementations in ancient compilers.
* Merge topic 'ninja-LIBPATH'Brad King2012-10-021-4/+7
|\ | | | | | | | | | | | | 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-4/+7
| | | | | | | | Don' pass linker option to the compile
* | Merge topic 'vs-pdb-output'Brad King2012-10-011-1/+5
|\ \ | |/ |/| | | | | | | | | | | 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)
| * Add PDB_OUTPUT_DIRECTORY and PDB_NAME target properties (#10830)Yuchen Deng2012-09-251-1/+5
| | | | | | | | | | | | | | 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>
* | Port cmLocalGenerator::GetTargetFlags to cmGeneratorTarget.Stephen Kelly2012-09-191-1/+1
| |
* | Make cmLocalGenerator::AddArchitectureFlags take a cmGeneratorTarget.Stephen Kelly2012-09-191-1/+1
|/
* Re-factor bundle content copying rules generation.Nicolas Despres2012-07-171-3/+1
|
* Re-factor CFBundle generation.Nicolas Despres2012-07-171-27/+2
|
* Re-factor OS X bundle and framework generation.Nicolas Despres2012-07-171-114/+17
|
* Remove trailing white-spaces.Nicolas Despres2012-07-171-8/+8
|
* Support building shared libraries or modules without soname (#13155)Modestas Vainius2012-04-301-1/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | | | Add a boolean target property NO_SONAME which may be used to disable soname for the specified shared library or module even if the platform supports it. This property should be useful for private shared libraries or various plugins which live in private directories and have not been designed to be found or loaded globally. Replace references to <CMAKE_SHARED_LIBRARY_SONAME_${LANG}_FLAG> and hard-coded -install_name flags with a conditional <SONAME_FLAG> which is expanded to the value of the CMAKE_SHARED_LIBRARY_SONAME_${LANG}_FLAG definition as long as soname supports is enabled for the target in question. Keep expanding CMAKE_SHARED_LIBRARY_SONAME_${LANG}_FLAG in rules in case third party projects still use it. Such projects would not yet use NO_SONAME so the adjacent <TARGET_SONAME> will always be expanded. Make <TARGET_INSTALLNAME_DIR> NO_SONAME aware as well. Since -install_name is soname on OS X, this should not be a problem if this variable is expanded only if soname is enabled. The Ninja generator performs rule variable substitution only once globally per rule to put its own placeholders. Final substitution is performed by ninja at build time. Therefore we cannot conditionally replace the soname placeholders on a per-target basis. Rather than omitting $SONAME from rules.ninja, simply do not write its contents for targets which have NO_SONAME. Since 3 variables are affected by NO_SONAME ($SONAME, $SONAME_FLAG, $INSTALLNAME_DIR), set them only if soname is enabled.
* Build object library targets in MakefilesBrad King2012-03-131-0/+26
| | | | | | Treat OBJECT libraries as STATIC libraries but leave out the archive step. The object files will be left behind for reference by other targets later.
* Add CMAKE_GNUtoMS option to convert GNU .dll.a to MS .libBrad King2011-12-051-0/+7
| | | | | | | | | | | | | | | | Teach the Windows-GNU.cmake platform file to look for Visual Studio tools matching the target ABI. Add an extra step to the link command for shared libraries and executables that export symbols and on which a new GNUtoMS property is set (initialized by the CMAKE_GNUtoMS option). Tell the GNU linker to output a module definition (.def) file listing exported symbols in addition to the GNU-format import library (.dll.a). Pass the .def file to the MS "lib" tool to construct a MS-format DLL import library (.lib). Teach the install(TARGETS) command to install the MS import library next to the GNU one. Teach the install(EXPORT) and export() command to set the IMPORTED_IMPLIB property pointing at the import library to use the import library matching the tools in the importing project.
* Factor makefile generator link rule lookup into helper functionBrad King2011-12-051-1/+1
| | | | | This provides a place in the makefile generators to adjust the link rules for both libraries and executables.
* Merge topic 'include-flags-response-file'Brad King2011-03-221-3/+3
|\ | | | | | | | | | | | | | | 86cb17b Pass include directories with response files to GNU on Windows 9a0b9bc Optionally pass include directories with response files 6e8a67f Generate target-wide flags before individual build rules d099546 Factor old-style -D flags out from -I flag generation
| * Generate target-wide flags before individual build rulesBrad King2011-03-171-3/+3
| | | | | | | | | | | | | | This switches the internal generation order but does not affect the results. The new order ensures that any internal state changed by generating target-wide flags is known when the individual rules that use those flags are generated.
* | Add support for CFBundle targets on the Mac (#11295)Richard Bateman2011-01-111-0/+49
|/ | | | | This commit enables building, for example, plugin bundles to be loaded by web browsers.
* Consolidate duplicate link rule make dependency codeBrad King2010-11-051-24/+1
| | | | | Factor code previously duplicated for library and executable rules into a common method.
* Add STATIC_LIBRARY_FLAGS_<CONFIG> property (#10768)Brad King2010-05-281-0/+4
| | | | This is a per-configuration version of STATIC_LIBRARY_FLAGS.
* -improve crosscompiling from Linux to iphone (#10526)Alex Neundorf2010-05-011-2/+0
| | | | | | Patch by Karol Krizka Alex
* Fix line-too-long style violationsBrad King2009-10-231-1/+2
| | | | | The commit "Define per-target OSX_ARCHITECTURES property" introduced some long lines. This wraps them into multiple shorter lines.
* Define per-target OSX_ARCHITECTURES propertyBrad King2009-10-211-0/+4
| | | | | | | | | | | The CMAKE_OSX_ARCHITECTURES variable works only as a global setting. This commit defines target properties OSX_ARCHITECTURES OSX_ARCHITECTURES_<CONFIG> to specify OS X architectures on a per-target and per-configuration basis. See issue #8725.
* Create INTERPROCEDURAL_OPTIMIZATION build featureBrad King2009-10-021-0/+6
| | | | | | | | This commit creates target and directory properties to enable the Intel interprocedural optimization support on Linux. Enabling it adds the compiler option '-ipo' and uses 'xiar' to create archives. See issue #9615.
* Centralize language flag addition for MakefilesBrad King2009-10-021-2/+4
| | | | | | We create cmMakefileTargetGenerator::AddFeatureFlags to consolidate addition of language flags. Currently it just adds the flags from generic per-language flag variables (AddLanguageFlags).
* Fix use of module .def files for MS toolsBrad King2009-09-291-23/+3
| | | | | | | We recognize .def source files and map them to the /DEF:<file> option in the MSVC tools. Previously this worked only for shared libraries. This commit cleans up the implementation and makes it work for executables too. See issue #9613.
* Convert CMake to OSI-approved BSD LicenseBrad King2009-09-281-14/+9
| | | | | | | This converts the CMake license to a pure 3-clause OSI-approved BSD License. We drop the previous license clause requiring modified versions to be plainly marked. We also update the CMake copyright to cover the full development time range.