Clang tooling requires that paths in the directory and file JSON
fields are relative to the directory field, but clang doesn't normalize
the paths already. The result is that clang doesn't find the relevant
entry for files which begin with ../.
We had complaints that people couldn't install the CMake source
tarball on some secure systems because there were "corrupt bz2
files" in it... We do not use these sample*.bz2 files anyhow
in the CMake build, so we'll just remove them.
Windows and Apple machines have predominantly used case-insensitive
filesystems so our file(INSTALL) command uses case-insensitive pattern
matching. It is implemented by converting the pattern and file path to
lower case before matching. The FILES_MATCHING option is implemented by
excluding a path that does not match any pattern unless it is a
directory that must be searched recursively. However, the test that an
excluded path is a directory is executed on the lower-case path and
therefore fails on mixed-case input paths on case-sensitive filesystems.
Fix the file(INSTALL) implementation to use the lower-case path only for
pattern matching and preserve the original path for tests against the
real filesystem.
bd34963 Refactor generation of shared library flags
55d7aa4 Add platform variable for flags specific to shared libraries
31d7a0f Add platform variables for position independent code flags
Older C++ compilers do not provide a standard std::stringstream.
Use our compatibility interfaces instead.
Also avoid std::stringstream(openmode) signature. Our approximate
stringstream implementation provided when the standard one is not
available does not support the openmode argument.
CMAKE_SHARED_LIBRARY_<lang>_FLAGS has flags on various platforms for a
variety of purposes that are correlated with shared libraries but not
exclusive to them. Refactor generation of these flags to use new
purpose-specific platform variables
CMAKE_<lang>_COMPILE_OPTIONS_DLL
CMAKE_<lang>_COMPILE_OPTIONS_PIC
CMAKE_<lang>_COMPILE_OPTIONS_PIE
Activate the DLL flags specifically for shared libraries. Add a new
POSITION_INDEPENDENT_CODE target property to activate PIC/PIE flags, and
default to true for shared libraries to preserve default behavior.
Initialize the new property from CMAKE_POSITION_INDEPENDENT_CODE to
allow easy global configuration in projects.
Although the default behavior is unchanged by this refactoring, the new
approach ignores CMAKE_SHARED_LIBRARY_<lang>_FLAGS completely. We must
leave it set in case projects reference the value. Furthermore, if a
project modifies CMAKE_SHARED_LIBRARY_<lang>_FLAGS it expects the new
value to be used. Add policy CMP0018 to handle compatibility with
projects that modify this platform variable.
Add a PositionIndependentCode test on platforms where we can get
meaningful results.
Store in new platform variables
CMAKE_${lang}_COMPILE_OPTIONS_PIC
CMAKE_${lang}_COMPILE_OPTIONS_PIE
flags for position independent code generation.
In almost all cases, this means duplication of the
CMAKE_SHARED_LIBRARY_${lang}_FLAGS for the _PIC case and using the
assumed pie equivalent for the _PIE case. Note that the GNU compiler
has supported -fPIE since 3.4 and that there is no -fPIC on GNU for
Windows or Cygwin.
There is a possibility that the _PIE variables are not correct.
However, as there is no backwards compatibility to be concerned about
(as the POSITION_INDEPENDENT_CODE property is not used anywhere yet),
the current state suffices.
When global property TARGET_SUPPORTS_SHARED_LIBS is FALSE we should
still allow OBJECT libraries. This was an oversight in commit b87d7a60
(Add OBJECT_LIBRARY target type, 2012-03-12). While at it, fix the
warning message to report context.
The <inttypes.h> header on some platforms define the integer format
macros incorrectly for some of the integer types. Document macros that
we can define to report such platforms to the includer. Check these
reports before trusting the system-defined macros.
Since commit c8ef6430 (Allow directory names containing '=' and warn if
necessary, 2012-02-06) we allow directories with '=' instead of
rejecting them as was previously done since commit 8704525f (Reject
directory names containing '=', 2011-01-14). However, we did not warn
in all cases that '=' may cause failure, such as when it appears on the
right-hand side of a dependency line.
Both commits above were made assuming that '=' cannot be escaped in Make
syntax, but it can be achieved with a variable:
EQUALS = =
left$(EQUALS)side : right$(EQUALS)side
Use this approach to escape '=' in dependency lines, thus supporting
the character in paths.
All our tests now pass when CMake is built in source and build trees
both containing '=', except for the "OutOfSource" test. It fails in
its coverage of the obscure "OutOfBinary" test case where part of the
build tree is located outside the main build tree of the test. The
reason is that CMake must invoke a command like
$(MAKE) -f /path/with=sign/build.make /path/with=sign/somefile
but the make tool interprets the last argument as a variable assignment.
This is an acceptable limitation, since the case is so obscure, in
exchange for supporting '=' cleanly otherwise.
When reading archive entries from disk strip any "fflags" entry headers
that may have been loaded from the filesystem when libarchive is built
with HAVE_STRUCT_STAT_ST_FLAGS (struct stat has 'st_flags'). The local
filesystem flags are not useful for distribution. Furthermore, GNU tar
does not understand the "SCHILY.fflags" extended header used to store
the flags in the archive. Use the approach from commit e8558efa
(cmArchiveWrite: Clear xattr and acl from entries, 2011-04-07) to remove
the flags and avoid producing the non-portable extended header.
Building CMake with g++ 2.9-aix51-020209 on an AIX 5.3 system gives:
cmsys/hashtable.hxx: In function `const long unsigned int *cmsys::get_stl_prime_list ()':
cmsys/hashtable.hxx:399: warning: sorry: semantics of inline function static data
`const long unsigned int _stl_prime_list[31]' are wrong (you'll wind up with multiple copies)
cmsys/hashtable.hxx:399: warning: you can work around this by removing the initializer
Give get_stl_prime_list internal linkage.