Commit Graph

18393 Commits

Author SHA1 Message Date
Brad King f5b06cda0f Pre-compute object file names before Ninja generation
Implement cmGlobalGenerator::ComputeTargetObjects in the Ninja generator
to pre-compute all the object file names.  Use the results during
generation instead of re-computing it later.
2012-03-16 10:18:35 -04:00
Brad King a2514f15fa Simplify cmNinjaTargetGenerator using cmGeneratorTarget
Replace the classification of source files in this generator using that
computed by cmGeneratorTarget.
2012-03-16 10:18:35 -04:00
Brad King c68cc06612 Merge branch 'object-library' into ninja-object-library 2012-03-16 10:18:01 -04:00
Brad King 48eb7fc7d7 Ninja: Avoid using 'this' in member initializers
VS complains

 warning C4355: 'this' : used in base member initializer list

so initialize the member in the constructor body instead.
2012-03-16 10:16:55 -04:00
Bill Hoffman bba37dd517 Ninja: Fix for PDB files with spaces in the path.
This calls ConvertToOutputFormat on the PDB paths for pdb file paths
used in both library creation and the building of object files.
2012-03-16 10:16:45 -04:00
Brad King 3a53005f7d Build object library targets in VS
Treat OBJECT libraries as STATIC libraries.  The VS project file format
provides no way to avoid running the librarian so hide the resulting
.lib away next to the object files as it should never be referenced.
The object files will be left behind for reference by other targets
later.
2012-03-13 14:38:02 -04:00
Brad King 3aa741acb6 Build object library targets in Makefiles
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.
2012-03-13 14:38:02 -04:00
Brad King b87d7a60a0 Add OBJECT_LIBRARY target type
This library type can compile sources to object files but does not link
or archive them.  It will be useful to reference from executable and
normal library targets for direct inclusion of object files in them.

Diagnose and reject the following as errors:

* An OBJECT library may not be referenced in target_link_libraries.

* An OBJECT library may contain only compiling sources and supporting
  headers and custom commands.  Other source types that are not normally
  ignored are not allowed.

* An OBJECT library may not have PRE_BUILD, PRE_LINK, or POST_BUILD
  commands.

* An OBJECT library may not be installed, exported, or imported.

Some of these cases may be supported in the future but are not for now.

Teach the VS generator that OBJECT_LIBRARY targets are "linkable" just
like STATIC_LIBRARY targets for the LinkLibraryDependencies behavior.
2012-03-13 14:37:32 -04:00
Brad King ac800f49d0 Ninja: Constify use of cmCustomCommand
The generator never needs to modify custom command instances.
2012-03-13 11:23:14 -04:00
Peter Kuemmel 9a0d5a828a Ninja: add /DEF: flag to linker call 2012-03-13 11:20:29 -04:00
Brad King d5aedf15a4 Merge branch 'test-RunCMake' into object-library 2012-03-12 16:44:49 -04:00
Brad King f737bd416a Pre-compute and store target object directory in cmGeneratorTarget
Add cmGeneratorTarget::ObjectDirectory member to hold the value.  In
ComputeTargetObjects set the value to the full path to the target object
directory including any necessary placeholder for the configuration
name.
2012-03-12 16:44:03 -04:00
Brad King 55b2aa884c Use generalized RunCMake test infrastrucure for build_command test
The CMakeCommands.build_command test performs output/error checking
so move it over to RunCMake to re-use the generalized infrastrucure.
This is the only test left using Tests/CMakeCommands/CMakeLists.txt
so remove it.
2012-03-12 09:33:21 -04:00
Brad King eb33000d75 Use generalized RunCMake test infrastrucure for find_package test 2012-03-12 09:33:21 -04:00
Brad King 42a81e7119 Add stronger infrastructure for CMake-only tests
The CMakeOnly directory added by commit 9a20abf0 (Add infrastructure for
CMake-only tests, 2012-01-11) was sufficient only for tests that always
run CMake to successfully configure a project.  Later commit eeaaffcb
(find_package: Test error and warning messages in failure cases,
2012-02-28) added a sample test that covers failure cases.

Generalize the above to create new "RunCMake" test infrastructure that
can run CMake multiple times for a single project with different
variations and check for expected result/stdout/stderr.  Allow for both
successful and failing CMake project configuration cases.  This will be
useful to test error messages and failure behavior.
2012-03-12 09:33:21 -04:00
Brad King 9c0a00d6dd Rename/constify build-time config placeholder lookup
Rename cmGlobalGenerator::GetCMakeCFG{InitDirectory => IntDir} to
have a shorter name without a typo.  Add a 'const' qualifier since
the method is only for lookup and never needs to modify anything.
2012-03-09 15:16:03 -05:00
Brad King 46f4940675 Remove unused cmSourceGroup method
The non-const GetSourceFiles method is not needed.
2012-03-09 15:16:03 -05:00
Brad King d57047de33 Pre-compute object file names before VS project generation
Implement cmGlobalGenerator::ComputeTargetObjects in the VS generator
to pre-compute all the object file names.  Use the results during
generation instead of re-computing it later.
2012-03-09 15:16:02 -05:00
Brad King 3baaf6ccec Pre-compute object file names before Makefile generation
Add a virtual cmGlobalGenerator::ComputeTargetObjects method invoked
during cmGeneratorTarget construction.  Implement it in the Makefile
generator to pre-compute all object file names for each target.  Use
the results during generation instead of re-computing it later.
2012-03-09 15:16:02 -05:00
Brad King 62a841b80b Simplify cmVisualStudio10TargetGenerator using cmGeneratorTarget
Use CustomCommands and ModuleDefinitionFile computed in the latter
instead of recomputing them from the original target source files.
2012-03-09 15:16:02 -05:00
Brad King 45c2f93240 Simplify cmMakefileTargetGenerator using cmGeneratorTarget
Replace the classification of source files in this generator
using that computed by cmGeneratorTarget.
2012-03-09 15:16:02 -05:00
Brad King 4b24558091 Create a cmGeneratorTarget for each cmTarget during generation
Construct the instances after the final set of targets is known but
before computing inter-target dependencies.  This order will allow
initialization of cmGeneratorTarget instances to adjust and finalize
declared inter-target dependencies.
2012-03-09 15:16:02 -05:00
Brad King 11d9b21126 Add cmGeneratorTarget to represent a target during generation
Some per-target information and logic is common to all generators.
Some of that information is currently stored in cmTarget but that
should be reserved for the configure step.  Create a class to hold
per-target information for generators.  On construction classify
sources from the target and store them in separate members.  This
classification is already implemented separately in each generator.
2012-03-09 15:16:02 -05:00
Brad King 51b67366ed Merge branch 'cleanup-object-file-names' into object-library 2012-03-09 15:15:37 -05:00
Bill Hoffman d40eebd89d Ninja: Add a cache option CMAKE_ENABLE_NINJA to enable the ninja generator.
Make the option default to on, for platforms where CMake passes
all tests with the ninja generator.  This is currently only Linux.
2012-03-09 14:28:21 -05:00
KWSys Robot c7bdef5b48 KWSys Nightly Date Stamp 2012-03-09 00:05:04 -05:00
David Cole 36ce6e01f8 Merge topic 'qt4-deploy'
2c601c1 DeployQt4: Add path to Qt dlls on Windows.
2012-03-08 15:14:40 -05:00
David Cole fa0f065426 Merge topic 'find_package_fatal_error_if_required_and_config_not_found'
c5ae733 find_package: Test that REQUIRED aborts processing correctly
c91a54d find_package: error out if REQUIRED Config has not been found
2012-03-08 15:14:23 -05:00
David Cole da43d8fa8d Merge topic 'MakingConfigFilesEasier_ConfigureMacro'
6973e2d wrap write_basic_config_version_file as write_basic_package_version_file()
204f5d4 add CMakePackageConfigHelpers: configure_package_config_file()
2012-03-08 15:14:12 -05:00
David Cole f55119e63b Merge topic 'fix-12189-support-SBCS-in-VS'
b28e7fa VS6: Avoid SBCS test on VS6 (#12189)
df19b9c VS6: Avoid _MBCS define when _SBCS is defined (#12189)
ba89e92 Visual Studio: Allow setting Single Byte Character Set (#12189)
2012-03-08 15:14:03 -05:00
David Cole 9f6c38253a Merge topic 'CPackNSIS-addMissingDoc'
d4719a8 Add some missing CPACK_NSIS_xxx doc and move some to common CPack section.
2012-03-08 15:13:51 -05:00
David Cole 9cdd989667 Merge topic 'fixCPackDocTypo'
b0cb29b Fix some typos in CPACK_SET_DESTDIR doc
2012-03-08 15:13:39 -05:00
David Cole 142facc6dd Merge topic 'fix-cygwin-hint-file'
208c3f8 Use correct "requires" line in cygwin setup hint file
1b996e7 Remove trailing white space
2012-03-08 15:13:27 -05:00
David Cole 580171185b Merge topic 'target-include-directories'
d662dff Fix shadowed variable warning on dashboard results
f66e735 Fix compiler warning reported on older Borland dashboard.
d90eed4 Fix compiler error reported on older Borland dashboard.
8233636 Update the documentation regarding INCLUDE_DIRECTORIES.
d899eb7 Call ExpandVariablesInString for each target's INCLUDE_DIRECTORIES
c21db87 Make search paths ordered and unique
22021f0 Remove cmMakefile::GetIncludeDirectories
9106b56 Extract and use the INCLUDE_DIRECTORIES target properties.
840509b Keep the INCLUDE_DIRECTORIES target property up to date.
a4d5f7b Add API to get the ordered includes for a target.
8adaee2 CMake: Eliminate cmMakefile::IncludeDirectories
7620932 Remove include flags memoization.
97a5faa Make it safe to call this method without creating duplicates.
edd5303 Refactor GetIncludeFlags to take includes instead of fetching them
2012-03-08 15:13:15 -05:00
Brad King 0996f2a228 Hide Makefile local object info inside local generator
Make cmLocalUnixMakefileGenerator3::LocalObjectInfo private and add
cmLocalUnixMakefileGenerator3::AddLocalObjectFile to create entries.
2012-03-08 07:58:52 -05:00
KWSys Robot 3a36fa9971 KWSys Nightly Date Stamp 2012-03-08 00:05:06 -05:00
David Cole 8c634330db Ninja: Add friend struct so it can access the private ConvertToNinjaPath.
The HP aCC compiler is apparently more strict than all our other
dashboard compilers with respect to complaining about this.
2012-03-07 16:24:34 -05:00
Peter Kuemmel dbe3dce546 Ninja: add .def file support 2012-03-07 16:24:34 -05:00
Peter Kuemmel f1bb08f55b Ninja: ensure the output dir exists at compile time 2012-03-07 16:24:33 -05:00
Clinton Stimpson 2c601c100b DeployQt4: Add path to Qt dlls on Windows. 2012-03-07 11:43:27 -07:00
Brad King c5ae733166 find_package: Test that REQUIRED aborts processing correctly
Verify that the command produces a FATAL_ERROR if and only if the
missing package is REQUIRED.
2012-03-07 11:34:59 -05:00
Alex Neundorf 6973e2d5a8 wrap write_basic_config_version_file as write_basic_package_version_file()
So the name fits better with configure_package_config_file(), as
discussed on the mailing list. Adapt the documentation accordingly.

Alex
2012-03-07 11:23:18 -05:00
Alex Neundorf 204f5d443c add CMakePackageConfigHelpers: configure_package_config_file()
The function configure_package_config_file() may be used instead of
configure_file() for generating the Config.cmake files for installation,
they help to make those files relocatable.

Alex
2012-03-07 11:23:11 -05:00
KWSys Robot 285f0db9f4 KWSys Nightly Date Stamp 2012-03-07 00:05:05 -05:00
David Cole b28e7fa174 VS6: Avoid SBCS test on VS6 (#12189)
The previous commit, df19b9ca, assumed that the corresponding
_UNICODE functionality in the VS6 generator actually worked.
That turns out not to be the case. Unicode definition does not
actually suppress _MBCS definition, so neither does this new
code...

Don't test it here, since the patch submitter for _SBCS does
not need VS6 support.

If somebody needs _UNICODE and _SBCS support to suppress the
definition of _MBCS in the VS6 generator, it is work yet to do.
Patches welcome.
2012-03-06 18:45:51 -05:00
Eric NOULARD d4719a8d36 Add some missing CPACK_NSIS_xxx doc and move some to common CPack section. 2012-03-06 23:23:08 +01:00
David Cole 50f9db9b00 Merge topic 'skip-install-rpath'
635bf50 Add an option to skip RPATH during installation.
2012-03-06 15:27:54 -05:00
David Cole e872b0d2b8 Merge topic 'win32_executable-and-macosx_bundle-initializers'
761c146 Add default initializers for WIN32_EXECUTABLE and MACOSX_BUNDLE
2012-03-06 15:27:44 -05:00
David Cole 663832eb44 Merge topic 'test-getpropery'
b43cd12 add test for get_property() errors
2012-03-06 15:27:28 -05:00
David Cole 7fbd323f80 Merge topic 'remove-unused-members'
aef248a Remove cmExprParserHelper::SetLineFile()
e266571 Remove UnionsAvailable member from 2 classes
2012-03-06 15:27:08 -05:00