Commit Graph

813 Commits

Author SHA1 Message Date
Brad King ccd5822a83 Merge topic 'osx-cfbundle-tweaks'
b189c599 Tests: Run CFBundleTest only with valid configuration
3a605693 Xcode: Call IsCFBundleOnApple to decide if bundle is being built
207b7af0 cmTarget: Use GetCFBundleDirectory within GetFullNameInternal
2014-12-19 08:26:57 -05:00
Gregor Jasny 207b7af00b cmTarget: Use GetCFBundleDirectory within GetFullNameInternal
Replace duplicated code by call to GetCFBundleDirectory.

Signed-off-by: Gregor Jasny <gjasny@googlemail.com>
2014-12-17 11:24:02 -05:00
Dmitry Polyanitsa eeaa25e521 Add 'ANDROID_API_MIN' target property to set Android Target MIN API
Also add a 'CMAKE_ANDROID_API_MIN' variable to set the property
default.  Teach the VS generator to write the MIN API value into
Nsight Tegra project files.
2014-12-17 11:17:28 -05:00
Sean McBride 2e92570bda Fix some Clang -Wstring-conversion warnings
Some false positives, but some flagged faulty asserts
where the ! was inside the string instead of outside.
2014-12-12 14:38:23 -05:00
Brad King 8e75f1d2fa Merge topic 'target-sources-error-conditions'
8a75c7ef Help: Document the export limitation of INTERFACE_SOURCES.
e1348056 Export: Disallow export of targets with INTERFACE_SOURCES
bb5905bb cmTarget: Don't allow relative paths in INTERFACE_SOURCES
2014-12-01 08:57:34 -05:00
Stephen Kelly bb5905bb13 cmTarget: Don't allow relative paths in INTERFACE_SOURCES
Follow the pattern of checks that are made for INTERFACE_INCLUDE_DIRECTORIES.
Existence is already checked by cmSourceFile::GetFullPath.  Add a check
to disallow relative paths in source directories. Otherwise code such as

 target_sources(lib1 INTERFACE foo.cpp)

would fail if consumed by a target in a different directory.

Unlike the INTERFACE_INCLUDE_DIRECTORIES behavior, we don't care whether
the entry comes from an IMPORTED target or not.  In the include directories
case, the directory for a non-imported target might not exist yet but
might be created.  In the sources case, a file which does not yet
exist in the filesystem must be explicitly marked with the GENERATED
property.

Adjust existing tests and add a new test for the error.
2014-11-29 12:24:59 +01:00
Brad King c7b9fad117 Merge topic 'remove-ancient-msvc-workarounds'
12cb0b86 Help: Update developer manual with some C++ features now permitted.
ba74465f cmGeneratorTarget: Remove MSVC7 workaround
41363c0c VisualStudio: Remove MSVC6 compatibility macro.
4efcfe52 cmSystemTools: Remove MSVC6 compatibility define.
5f4695cd cmStandardIncludes: Remove MSVC6 condition for cmArrayBegin macro.
7a064337 cmFindCommon: Remove MSVC6 workaround for nested struct private access.
fdb73547 cmTarget: Remove std::min and std::max MSVC6 compatibility code.
2014-11-25 10:28:57 -05:00
Brad King 4987b37165 Merge topic 'remove-c_str'
5eb4d759 Remove some unneeded c_str calls.
2014-11-25 10:18:49 -05:00
Stephen Kelly 5eb4d7590e Remove some unneeded c_str calls. 2014-11-23 11:09:54 +01:00
Stephen Kelly fdb7354722 cmTarget: Remove std::min and std::max MSVC6 compatibility code.
CMake is no longer required to build with MSVC6.
2014-11-20 22:17:16 +01:00
Brad King 32a191ce4b cmTarget: Use null_ptr code path on all platforms
This reduces conversions asked of the compiler.  Also drop 'static' from
the declaration of the local null_ptr helper.
2014-11-20 10:22:07 -05:00
Nils Gladitz cc1139cc30 strings: Remove redundant calls to std::string::c_str()
Replacements were detected and performed by the clang tool
remove-cstr-calls on a linux build.
2014-10-15 14:54:05 +02:00
Brad King 34d035e70e Merge topic 'vs-nsight-tegra-generator'
df84281d Help: Add notes for topic 'vs-nsight-tegra-generator'
69e198dc VS: Generate Nsight Tegra project revision number
5365c9ac VS: Map Nsight Tegra file types in .vcxproj files
178f56a5 VS: Fix Tegra-Android platform linking of libraries by name
7115702f Tests: Add test for VS Nsight Tegra generator support
a6289499 VS: Generate ANDROID_GUI executables as app packages
c12e4699 Add 'ANDROID_API' target property to set Android Target API
9a4df52a Add 'ANDROID_GUI' target property to mark Android applications
16569abf cmTarget: Track internally whether platform is Android
ef0fd4f0 VS: Teach vcxproj generation about the Tegra-Android platform
d09b60f5 VS: Detect compiler id of Nsight Tegra-Android toolchains
2f071466 VS: Teach VS >= 10 to recognize CMAKE_SYSTEM_NAME 'Android'
2014-09-30 08:46:27 -04:00
Brad King c12e46991e Add 'ANDROID_API' target property to set Android Target API
Also add a 'CMAKE_ANDROID_API' variable to set the property default.
2014-09-30 08:45:34 -04:00
Brad King 9a4df52aa1 Add 'ANDROID_GUI' target property to mark Android applications
Also add a 'CMAKE_ANDROID_GUI' variable to set the property default
so a project can easily make all executables Android applications.
An Android application executable file has the same extension as a
shared library (.so).
2014-09-29 16:05:53 -04:00
Brad King 16569abfa8 cmTarget: Track internally whether platform is Android
Add an IsAndroid member to save whether CMAKE_SYSTEM_NAME is "Android".
2014-09-29 16:05:53 -04:00
Brad King 92b2c6189d Remove extra slashes from LOCATION target property value
In commit v3.0.0-rc1~429^2~2 (Remove the Location member from cmTarget,
2012-10-07) a few extra slashes were added to the path construction
logic, perhaps due to a partially implemented attempt at handling the
case that GetDirectory returns an empty string.  This leads to LOCATION
paths with double slashes in some cases.  Remove them now.
2014-09-22 09:32:21 -04:00
Brad King b2282631f6 cmTarget: Do not mistake a preceding error for a CMP0049 failure
After calls to ProcessSourceItemCMP0049, check for an empty return
string to detect a failure instead of trusting GetErrorOccuredFlag.
The latter could have been left from a preceding non-fatal error.

Extend the RunCMake.Configure test to cover a case that exposed this
problem.
2014-07-30 13:48:33 -04:00
Brad King 7b743a2e76 cmTarget: Avoid re-computing head-independent link interfaces 2014-07-21 13:04:04 -04:00
Brad King 46099b82ed cmTarget: Move ComputeLinkImplementation* to internals
There are no external callers, and this will allow the methods to see
the full OptionalLinkImplementation internal structure.
2014-07-21 11:55:56 -04:00
Brad King 438d9c7c82 cmTarget: Re-order link interface map lookup logic
In GetLinkInterface, GetLinkInterfaceLibraries, and
GetImportLinkInterface, lookup the HeadToLinkInterfaceMap for the
current configuration first, and then index it by head target.  In
GetLinkImplementationLibrariesInternal, lookup the
HeadToLinkImplementationMap for the current configuration first, and
then index it by head target.
2014-07-21 11:43:30 -04:00
Brad King fe665fdda8 cmTarget: Refactor link interface map storage
Convert LinkInterfaceMapType and LinkImplMapType to nested maps that
index on configuration first and 'head' target second.
2014-07-21 11:26:10 -04:00
Brad King 9d13e1679f cmTarget: Remove duplicate link interface map
No target is both imported and not imported so we do not need separate
link interface maps for them.
2014-07-21 11:16:45 -04:00
Brad King 133cd996d1 cmTarget: Drop internal cache of build properties
These use a huge amount of memory that accumulates as generation
proceeds.  On the Unix Makefiles generator, only GetIncludeDirectories
and GetCompileDefinitions are even called more than once per target
(once for build files, once for dependency scanning preprocessor info).
Another approach will be needed to avoid duplicate computation in the
cases where it does occur.
2014-07-21 11:00:34 -04:00
Brad King a4d58722a4 cmTarget: Drop internal cache of link interface usage requirements
These use a huge amount of memory that accumulates as generation
proceeds.  On the Unix Makefiles generator, only GetIncludeDirectories
and GetCompileDefinitions are even called more than once per target
(once for build files, once for dependency scanning preprocessor info).
Another approach will be needed to avoid duplicate computation in the
cases where it does occur.
2014-07-21 11:00:33 -04:00
Brad King 36a8184d40 Merge topic 'dev/target-fastpaths'
a9c9b66c cmTarget: use a hash_map for cmTargets typedef
bcb6dbc1 cmTarget: help the optimizer a bit
679f3dee cmTarget: use hash_set for sets of strings
23d6520d cmTarget: Allow caching of empty genex expansions
cd54f1db cmTarget: Only copy GenEx expansions when necessary
b75fc0e1 cmTarget: Don't set properties on custom targets
66076915 cmTarget: Use static strings for special property names
cebefa71 cmTarget: Sort special property checks
97ce676e cmTarget: Fast path for regular properties
4cfa918a cmTarget: Factor out common code
85242b7d cmTarget: Use else/if trees rather than an if tree
2014-07-18 11:00:29 -04:00
Ben Boeckel bcb6dbc1cb cmTarget: help the optimizer a bit 2014-07-17 11:17:52 -04:00
Ben Boeckel 679f3deeb7 cmTarget: use hash_set for sets of strings 2014-07-17 11:17:50 -04:00
Ben Boeckel 23d6520daa cmTarget: Allow caching of empty genex expansions 2014-07-17 11:17:50 -04:00
Ben Boeckel cd54f1dbeb cmTarget: Only copy GenEx expansions when necessary 2014-07-17 11:17:50 -04:00
Ben Boeckel b75fc0e1ad cmTarget: Don't set properties on custom targets
Properties are not required on custom targets.
2014-07-17 11:17:50 -04:00
Ben Boeckel 660769151a cmTarget: Use static strings for special property names
The function is called enough that the std::string/cstr comparisons are
expensive from the strlen. Cache the strings for faster comparisons.
2014-07-17 11:17:50 -04:00
Ben Boeckel cebefa71fa cmTarget: Sort special property checks
The LINK_LIBRARIES property is by *far* the most popular. Move it to the
top. TYPE is second, but with more generator expression usage, that may
change in the future.
2014-07-17 11:17:49 -04:00
Ben Boeckel 97ce676e75 cmTarget: Fast path for regular properties 2014-07-17 11:17:49 -04:00
Ben Boeckel 4cfa918a9a cmTarget: Factor out common code 2014-07-16 17:28:32 -04:00
Ben Boeckel 85242b7df6 cmTarget: Use else/if trees rather than an if tree
Skips lots of unnecessary string comparisons.
2014-07-16 17:28:32 -04:00
Brad King c45dd669ab cmTarget: Cache compatible interface property sets
Replace isLinkDependentProperty with a CompatibleInterfaces structure
that records all the compatible interface properties in a set for each
type.  This avoids repeatedly traversing the link implementation closure
and asking every target for its compatible interface properties.
2014-07-16 13:38:22 -04:00
Brad King 89095514a7 cmTarget: Refactor GetLinkImplementationClosure internals
Store the 'Done' flag directly in each map entry instead of using a
separate map.
2014-07-16 13:38:22 -04:00
Brad King 0a8fbac19a cmTarget: Drop GetTransitivePropertyTargets method
Inline the implementation at the only remaining call site.
2014-07-16 13:31:29 -04:00
Brad King 535fd6ce6d cmTarget: Make GetLink*Libraries methods safer to use
Split the library lists out of LinkImplementation and LinkInterface into
LinkImplementationLibraries and LinkInterfaceLibraries parent classes,
respectively.  Return these from GetLinkImplementationLibraries and
GetLinkInterfaceLibraries, respectively, so that callers cannot access
parts of the structures that have not been populated.
2014-07-16 13:31:29 -04:00
Brad King 6e7e881c57 Honor $<LINK_ONLY> when checking interface properties
Callers of cmTarget::GetLinkImplementationClosure are interested in the
set of targets whose interface properties propagate to the current
target.  This excludes targets guarded by $<LINK_ONLY>.

Teach the CompatibleInterface test to cover suppression of interface
compatibility tests with $<LINK_ONLY>.  Although this is not recommended
in practice, it is a way of covering the above behavior.
2014-07-16 13:28:47 -04:00
Brad King 0400cd5dd1 Make $<LINK_ONLY> available to projects (#14751)
Previously this generator expression was used internally by the
target_link_libraries command to honor private linking requirements of
static libraries in their INTERFACE_LINK_LIBRARIES.  Remove the check
that limits $<LINK_ONLY> to this use case to make it available for
project code to use too.
2014-07-16 13:28:44 -04:00
Brad King a0dc1354fe Merge topic 'refactor-link-internals'
1ca0c0e9 cmTarget: Refactor internal imported LinkInterface map
102eea60 cmTarget: Simplify internal ComputeLinkInterfaceLibraries method
b0f57408 cmTarget: Move ComputeLinkInterfaceLibraries to internals
c69e8a55 cmTarget: Refactor internal LinkInterface map
4db3990e cmTarget: Drop 'head' argument from processSources
4b8130b8 cmTarget: Drop 'head' argument from GetSourceFiles
4c763dd1 cmTarget: Drop 'head' argument from GetLanguages
190cabe7 cmTarget: Drop 'head' argument from ComputeLinkImplementationLanguages
2014-07-16 13:04:21 -04:00
Brad King 8a205b980c cmTarget: Compile old-style link dependencies only for VS 6
Compile all the "ForVS6" cmTarget members only on Windows.  No other
platforms support the VS 6 generator.
2014-07-14 14:39:20 -04:00
Brad King d57be904ae cmTarget: Run old-style link dependencies only for VS 6
Invoke it at runtime only with the VS 6 generator.  No other generators
need it.
2014-07-14 14:38:58 -04:00
Brad King b3b44d138e cmTarget: Rename old-style link dependencies code as "ForVS6"
The old link dependency analysis is now needed only for the VS 6
generator code delimited by CM_USE_OLD_VS6 to support project-provided
project templates.  Rename the related cmTarget members to be "ForVS6".
2014-07-14 14:37:04 -04:00
Brad King 1ca0c0e94a cmTarget: Refactor internal imported LinkInterface map
Create the map entry up front and store in it a boolean value indicating
whether the LinkInterface structure has been populated.  This approach
leads to shorter code that is easier to follow too.
2014-07-14 10:21:46 -04:00
Brad King 102eea60cd cmTarget: Simplify internal ComputeLinkInterfaceLibraries method
Now that the method can see the full OptionalLinkInterface structure,
store information there instead of passing it through arguments.
2014-07-14 10:00:51 -04:00
Brad King b0f5740851 cmTarget: Move ComputeLinkInterfaceLibraries to internals
There are no external callers, and this will allow the method to see
the full OptionalLinkInterface internal structure.
2014-07-14 09:55:52 -04:00
Brad King c69e8a5580 cmTarget: Refactor internal LinkInterface map
Create the map entry up front and store in it boolean values indicating
which pieces of the LinkInterface structure have been populated.
This approach leads to shorter code that is easier to follow too.
2014-07-14 09:51:51 -04:00