Commit Graph

148 Commits

Author SHA1 Message Date
Brad King 9a0b9bc8b7 Optionally pass include directories with response files
Create platform option CMAKE_<lang>_USE_RESPONSE_FILE_FOR_INCLUDES to
enable use of response files for passing the list of include directories
to compiler command lines.
2011-03-17 17:56:13 -04:00
Brad King d099546450 Factor old-style -D flags out from -I flag generation
Move the GetDefineFlags call from cmLocalGenerator::GetIncludeFlags to
all call sites so that the method exclusively constructs a string of
include search path flags.
2011-03-15 13:09:06 -04:00
Brad King ed9979f931 Merge topic 'link-depend-def-file'
3e27997 Make link rule depend on ".def" file (#11014)
2010-12-16 14:00:17 -05:00
Brad King 4f769d18d1 Merge topic 'cray-compiler'
ab9ebb0 Fix Fortran .mod timestamps with Cray compiler
2010-12-16 13:59:57 -05:00
Brad King 3e279971fb Make link rule depend on ".def" file (#11014)
When the link command line references a ".def" file the rule should
depend on it.

Inspired-By: Eric Huhtala
2010-12-15 11:30:57 -05:00
Brad King 5622a16f1f Make Fortran $obj.provides.build targets not .PHONY
Commit 60cd72d0 (Cleaned up generation of symbolic rules, 2006-02-15)
incorrectly made these Makefile targets .PHONY even though the build
rule touches an actual file.  Correct it so that the copy_f90_mod and
touch steps do not happen on every "make".
2010-12-06 16:43:04 -05:00
Brad King ab9ebb017e Fix Fortran .mod timestamps with Cray compiler
Commit 34e1ac24 (Create Fortran info variables for .mod behavior,
2010-11-12) incorrectly taught GetFortranModuleDirectory to return a
relative path.  We really want to use "." as the module directory only
as a workaround for compilers that do not do so by default.  Therefore
we need this default only when generating the compiler command line and
not when scanning dependencies.

Revert the previous change to GetFortranModuleDirectory and apply the
change only at one of its call sites.
2010-12-06 10:35:25 -05:00
Brad King 34e1ac2489 Create Fortran info variables for .mod behavior
Define CMAKE_Fortran_MODDIR_DEFAULT and CMAKE_Fortran_MODOUT_FLAG
variables to help some Fortran compilers generate .mod files in the
current working directory.
2010-11-12 09:03:49 -05:00
Brad King 95f149e61f Define LINK_DEPENDS target property (#11406)
Custom Makefile link rules may need to depend on linker scripts.  Define
this property to allow user-specified link-time dependencies.
2010-11-05 09:05:08 -04:00
Brad King 07cfa57ec5 Consolidate duplicate link rule make dependency code
Factor code previously duplicated for library and executable rules into
a common method.
2010-11-05 08:33:47 -04:00
Brad King 5444bd6ca3 Merge branch 'tru64-make-includes' 2010-06-15 14:03:26 -04:00
Brad King d9b2da139d Merge branch 'mingw-response-files' 2010-06-15 13:58:58 -04:00
Brad King c592df8377 Tru64: Use full-path include directives in Makefiles (#10569)
Tru64's make(1) resolves relative paths in "include" directives with
respect to the includer.  This is inconsistent with all other known make
tools.  Note that this make tool treats the path literally so we cannot
use our standard FULL path code which escapes spaces.  Instead qualify
the paths with $(CMAKE_BINARY_DIR) to avoid the problem.
2010-06-14 13:06:39 -04:00
Alex Neundorf d7ceb75e8a -fix GetFrameworkFlags() for Mac, which was broken with my last commit
Alex
2010-05-03 21:28:44 +02:00
Alex Neundorf 3901e0408c -improve crosscompiling from Linux to iphone (#10526)
Patch by Karol Krizka

Alex
2010-05-01 20:38:28 +02:00
Brad King f9268c9c81 Use platform variable for response file flag
Create platform variable "CMAKE_<LANG>_RESPONSE_FILE_LINK_FLAG" to
specify an alternative to "@" for referencing response files.  It
applies specifically to response files with linker options.

See issue #10401.
2010-03-11 09:43:33 -05:00
Brad King 87f0853941 Use forward slashes for objects in response files
Response files are parsed by tools, not by shells.  We teach
cmLocalGenerator::Convert() a new "RESPONSE" output format and use it
for objects listed in response files.  It does not do special slash or
MSYS root translation like the "SHELL" format does.  This is necessary
for GNU tools on Windows to understand response file content.

See issue #10401.
2010-03-11 09:40:24 -05:00
Brad King 867a1cc12c Fix line-too-long style violations
The commit "Define per-target OSX_ARCHITECTURES property" introduced
some long lines.  This wraps them into multiple shorter lines.
2009-10-23 08:02:24 -04:00
Brad King 2dc39b8c32 Define per-target OSX_ARCHITECTURES property
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.
2009-10-21 13:00:49 -04:00
Alexander Neundorf eb91859d6f remove unused variables, reported by icpc
Alex
2009-10-03 08:35:57 -04:00
Brad King c513962701 Create INTERPROCEDURAL_OPTIMIZATION build feature
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.
2009-10-02 13:52:13 -04:00
Brad King 1e48243591 Introduce "build feature" lookup framework
This creates cmTarget::GetFeature and cmMakefile::GetFeature methods to
query "build feature" properties.  These methods handle local-to-global
scope and per-configuration property lookup.  Specific build features
will be defined later.
2009-10-02 13:52:01 -04:00
Brad King 57df2abca8 Centralize language flag addition for Makefiles
We create cmMakefileTargetGenerator::AddFeatureFlags to consolidate
addition of language flags.  Currently it just adds the flags from
generic per-language flag variables (AddLanguageFlags).
2009-10-02 13:51:49 -04:00
Brad King 67530409a9 Fix module definition file reference for VS6 NMake
When building through NMake with VS 6, the module definition file must
be passed without spaces in the path.  This is because 'cl -link' does
not escape the spaces when passing the value on to the linker.
2009-09-30 10:12:54 -04:00
Brad King 024d05adad Fix use of module .def files for MS tools
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.
2009-09-29 16:39:07 -04:00
Brad King 96afb12087 Convert CMake to OSI-approved BSD License
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.
2009-09-28 11:43:28 -04:00
Brad King c87a35a326 Do not call CollapseFullPath for PDB file names
Some vendor tools convert PDB file names given on the command line to
lower-case before creating the file.  When CMake places a mixed-case PDB
file name into the build system, the file does not exist the first time
and it is written with mixed case.  After the first build though the
native tool has created a lower-case version of the file.  If CMake does
CollapseFullPath again, the file exists so the actual-case lookup gets
the lower-case name.  This causes the build files to change so the
project rebuilds.

The solution is to avoid calling CollapseFullPath for files generated by
the build.  In the case of PDB files we already construct them from
paths that have been collapsed, so we can just skip the call altogether.
See issue #9350.
2009-09-17 08:42:31 -04:00
Brad King bde145a212 ENH: Pass config to cmTarget::GetDirectory()
This teaches the makefile generators to always pass the configuration
name to the cmTarget::GetDirectory method.  Later this will allow
per-configuration target output directories, and it cleans up use of the
current API.
2009-07-03 10:34:10 -04:00
Brad King 11d1063452 ENH: Create cmMakefileTargetGenerator::ConfigName
This member stores the build configuration for which Makefiles are being
generated.  It saves repeated lookup of the equivalent member from
cmLocalUnixMakefileGenerator3, making code shorter and more readable.
2009-07-03 08:41:10 -04:00
Brad King cd83f1979d ENH: Cleanup make progress rule generation code
This cleans up the Makefile generator's progress rule code.  Instead of
keeping every cmMakefileTargetGenerator instance alive to generate
progress, we keep only the information necessary in a single table.
This approach keeps most of the code in cmGlobalUnixMakefileGenerator3,
thus simplifying its public interface.
2009-06-25 09:58:51 -04:00
Brad King 493f88ce55 ENH: Allow projects to disable per-rule echo lines
This creates global property RULE_MESSAGES which can be set to disbale
per-rule progress and action reporting.  On Windows, these reports may
cause a noticable delay due to the cost of starting extra processes.
This feature will allow scripted builds to avoid the cost since they do
not need detailed information anyway.  This replaces the RULE_PROGRESS
property created earlier as it is more complete.  See issue #8726.
2009-03-16 16:55:58 -04:00
Brad King 2f651c2e59 ENH: Allow projects to disable per-rule progress
This creates global property RULE_PROGRESS which can be set to disbale
per-rule progress reporting.  On Windows, progress reports may cause a
noticable delay due to the cost of starting an extra process.  This
feature will allow scripted builds to avoid the cost since they do not
need detailed progress anyway.  See issue #8726.
2009-03-16 16:22:19 -04:00
Brad King 741ae600c4 ENH: Factor out makefile progress rule commands
This factors duplicate progress rule code into a common method.
2009-03-16 16:22:13 -04:00
Brad King b41c8fe23e BUG: Pass shared library export symbol in DEFINES
The <target>_EXPORTS macro defined for object files when built in a
shared library <target> should be put in the <DEFINES> make rule
replacement and not <FLAGS>.  Also, it should honor the platform
variable CMAKE_<LANG>_DEFINE_FLAG.  See issue #8107.
2009-02-27 12:59:52 -05:00
Brad King b604b98c56 ENH: Define RULE_LAUNCH_* properties
This defines global, directory, and target properties
RULE_LAUNCH_COMPILE, RULE_LAUNCH_LINK, and RULE_LAUNCH_CUSTOM.  Their
values specify 'launcher' command lines which are prefixed to compile,
link, and custom build rules by Makefile generators.
2009-02-10 08:51:15 -05:00
Brad King c895d9f2e0 ENH: Give target in which custom commands build
This gives the cmTarget instance for which custom command rules are
being generated to cmLocalUnixMakefileGenerator3::AppendCustomCommands.
It will be useful in the future.
2009-02-10 08:50:33 -05:00
Brad King 084e5a5e9e BUG: Fix preprocess and assembly rule expansion
The recent change to avoid expanding rule variables in informational and
'cd' commands broke the logical order in generation of preprocess and
assembly rules.  This corrects the order.
2009-02-02 14:36:53 -05:00
Brad King 496c203a0b BUG: Do not expand rule variables in info rules
Previously the makefile generator would expand rule variables even on
its progress and echo commands for object compilation rules (but not for
link rules).  This fixes the implementation to only expand rule
variables on user-specified rules.
2009-02-02 13:28:17 -05:00
Brad King ac9b7ec155 ENH: Refactor custom command rule hashing
This simplifies computation of custom command rule hashes to hash
content exactly chosen as the custom commands are generated.
Unfortunately this will change the hashes of existing build trees from
earlier CMake versions, but this is not a big deal.  The change is
necessary so that in the future we can make optional adjustments to
custom command lines at generate time without changing the hashes every
time the option is changed.
2009-02-02 13:28:12 -05:00
Brad King 690121f098 BUG: Fix color check for dependency scanning
Generation of color rules for dependency scanning messages did not
account for disabling color at generation time.  See issue #7814.
2008-10-15 10:40:57 -04:00
Brad King 9c29a72fbc ENH: Support object lists longer than 128K on MSVC
We use response files to list object files for the MSVC linker.  The
linker complains if any response file is greater than 128K, so we split
the object file lists into multiple response files.
2008-10-15 10:21:21 -04:00
Brad King 07454a39f1 ENH: Factor out listing of objects on command line
Previously generation of object file lists for linker and cleaning
command lines was duplicated for library and executable target
generators.  This combines the implementations.
2008-10-15 10:21:14 -04:00
Brad King ad44a41a18 ENH: Fix optional use of relative paths.
These changes refactor cmLocalGenerator methods Convert and
ConvertToOutputForExisting to support references inside the build tree
using relative paths.  After this commit, all tests pass with Makefile
generators when relative paths are enabled by default.  See issue #7779.
2008-10-09 15:30:07 -04:00
Brad King 8bffd5af36 ENH: Simplify framework -F flag generation
This removes an unnecessary use of ConvertToOutputForExisting which is
needed only on Windows to consider short-pathing.
2008-10-09 15:07:35 -04:00
Brad King 434d07afe6 ENH: Use new link info during dependency scanning
This removes another use of the old-style link line computation.
2008-09-15 13:30:17 -04:00
Brad King e79b73d61f BUG: Include less content as input to "rule hash" computation.
- The rule hash should use only commands specified by the user.
  - No make output (echo and progress) rules should be included.
  - No outputs or dependencies need be included.  The native build tool
    will take care of them.
2008-06-03 09:55:28 -04:00
Brad King 6be09c3667 ENH: Introduce "rule hashes" to help rebuild files when rules change.
- In CMake 2.4 custom commands would not rebuild when rules changed.
  - In CMake 2.6.0 custom commands have a dependency on build.make
    which causes them to rebuild when changed, but also when any
    source is added or removed.  This is too often.
  - We cannot have a per-rule file because Windows filesystems
    do not deal well with lots of small files.
  - Instead we add a persistent CMakeFiles/CMakeRuleHashes.txt file
    at the top of the build tree that is updated during each
    CMake Generate step.  It records a hash of the build rule for
    each file to be built.  When the hash changes the file is
    removed so that it will be rebuilt.
2008-06-02 16:44:58 -04:00
Brad King 23a60d561c BUG: Fix makefile generator to have link rules depend on all full path libraries that appear on the link line. This allows projects to relink when imported targets have changed. 2008-05-21 19:57:35 -04:00
Brad King 600e5e274e ENH: Add SKIP_RULE_DEPENDS option for add_custom_command()
- Allows make rules to be created with no dependencies.
  - Such rules will not re-run even if the commands themselves change.
  - Useful to create rules that run only if the output is missing.
2008-05-14 11:38:47 -04:00
Brad King 071725a1c1 BUG: Fix generation of some paths into .cmake files in the build tree to escape strings for the CMake language. This fix allows users to put double quotes in the SOVERSION of a shared library. 2008-05-10 18:39:06 -04:00