Commit Graph

25970 Commits

Author SHA1 Message Date
Regina Pfeifer
9eb0e73f46 cmRange: Move to dedicated header file 2019-02-21 08:24:25 -05:00
Brad King
2bff8513f2 Merge topic 'modernize-for-loops-c-arrays'
706b93fa55 Modernize: C-arrays and loops over them

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !2951
2019-02-19 07:56:41 -05:00
Brad King
2dd2079152 Merge topic 'fix-legacy-implicit-includes'
890bae524c Do not explicitly report "standard" include directories as implicit
5c171ca898 Restore unconditional use of "standard" include directories
9502276f82 Prefix implicit include directories with sysroot on construction

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !2981
2019-02-19 07:54:57 -05:00
Kitware Robot
2a1f661791 CMake Nightly Date Stamp 2019-02-19 00:01:06 -05:00
Brad King
890bae524c Do not explicitly report "standard" include directories as implicit
In commit 1293ed8507 (ParseImplicitIncludeInfo: keep implicit incl.
consistent when rerunning cmake, 2019-01-30, v3.14.0-rc1~26^2) we did
not account for `CMAKE_<LANG>_STANDARD_INCLUDE_DIRECTORIES`.  This
variable lets platform modules or toolchain files specify directories
that are to be explicitly passed as standard include directories.  These
include directories are used by the test project from which we extract
implicit include directories so they appear in the parsed results
whether or not the compiler really considers them implicit.  Exclude
these entries from the computed implicit include directories since they
are not actually implied by the compiler when we invoke it with
"standard" include directories passed explicitly.

Instead teach the build system generators to treat the "standard"
directories as implicit for purposes of excluding them from appearing
earlier in the compiler command line due to `include_directories` and
`target_include_directories` calls.

Issue: #18936, #18944
2019-02-18 17:12:14 -05:00
Brad King
5c171ca898 Restore unconditional use of "standard" include directories
`CMAKE_<LANG>_STANDARD_INCLUDE_DIRECTORIES` is meant to unconditionally
add explicitly specified include directories to compile lines.  In
commit 5f34bdc7f9 (cmLocalGenerator: Refactor
`GetIncludeDirectoriesImplicit` method, 2019-01-25, v3.14.0-rc1~65^2~1)
a condition was accidentally added to exclude implicit include
directories.  Drop that condition.

Fixes: #18936
2019-02-18 17:10:07 -05:00
Brad King
9502276f82 Prefix implicit include directories with sysroot on construction
Since commit 7cd65c97fa (Add CMAKE_SYSROOT variable to set --sysroot
when cross compiling., 2013-04-13, v3.0.0-rc1~342^2) we have prefixed
the value of `CMAKE_SYSROOT` to implicit include directories.  This was
done because we hard-coded `/usr/include` as an implicit include
directory without accounting for the sysroot.  Instead we should prefix
the hard-coded paths when they are constructed.  Update the
`Platform/UnixPaths` module to do this as `Platform/Darwin` already
does.

Since commit 5990ecb741 (Compute implicit include directories from
compiler output, 2018-12-07, v3.14.0-rc1~108^2) the values of the
`CMAKE_<LANG>_IMPLICIT_INCLUDE_DIRECTORIES` variables are computed from
a real compiler invocation so they already account for the sysroot
prefix.  In commit 6fc3382944 (Update logic for sysroot in detected
implicit include directories, 2019-02-13, v3.14.0-rc2~6^2) we attempted
to apply the prefix conditionally, but that is incorrect because the
compiler's real implicit include directories are not all under the
sysroot.  Instead assume that all implicit include directories in
`CMAKE_<LANG>_IMPLICIT_INCLUDE_DIRECTORIES` already have the sysroot
prefix if needed.  Code that constructs the value must be responsible
for that because it is the only place that knows.
2019-02-18 17:09:26 -05:00
Brad King
0923246b2e Merge topic 'require-xcode-5'
afb325018e Xcode: Require at least Xcode 5

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !2975
2019-02-18 09:20:16 -05:00
Brad King
03e10384ec Merge topic 'delete_copy_assign'
ae5e97a005 Delete some default constructors and assignment operators

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !2968
2019-02-18 09:05:30 -05:00
Kitware Robot
f1235fd37d CMake Nightly Date Stamp 2019-02-18 00:01:19 -05:00
Kitware Robot
8ec1942f62 CMake Nightly Date Stamp 2019-02-17 00:01:05 -05:00
Gregor Jasny
afb325018e Xcode: Require at least Xcode 5 2019-02-16 15:20:39 +01:00
Kitware Robot
657b30905a CMake Nightly Date Stamp 2019-02-16 00:01:07 -05:00
Artur Ryt
706b93fa55 Modernize: C-arrays and loops over them
It replaces C arrays with deduced std::initializer_lists
or std::array what makes enables for-loop over them.
2019-02-15 23:40:30 +01:00
Brad King
820424d95d Merge topic 'systools-cleanup'
bd20cc29a2 cmSystemTools: Remove redundant cmCopyFile() and Split()

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !2966
2019-02-15 10:04:49 -05:00
Kyle Edwards
160735c479 Merge topic 'remove_return_void'
30faf72625 Remove return from void function

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !2969
2019-02-15 10:02:10 -05:00
Brad King
f2dc10d55c Merge topic 'ninja-swift-library-name'
157570b5a2 Add placeholder for Swift's library name

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !2902
2019-02-15 10:00:21 -05:00
Brad King
3c9c91a360 Merge topic 'update-kwsys'
f510aafbfc Merge branch 'upstream-KWSys' into update-kwsys
a930de85d8 KWSys 2019-02-14 (e270ce9f)

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !2967
2019-02-15 09:59:40 -05:00
Vitaly Stakhovsky
bd20cc29a2 cmSystemTools: Remove redundant cmCopyFile() and Split() 2019-02-15 09:52:29 -05:00
Brad King
3bc2fb55b4 Merge topic 'vs2017-sdk81'
5c26e3c5e3 VS: Fix validation of Windows 8.1 SDK

Acked-by: Kitware Robot <kwrobot@kitware.com>
Acked-by: Dedmen Miller <dedmenmiller@googlemail.com>
Merge-request: !2962
2019-02-15 07:29:05 -05:00
Albert Astals Cid
ae5e97a005 Delete some default constructors and assignment operators
They are unused, but if someone used them they would lead to
problems since they would copy the internal raw pointers
and the destructor would cause double delete
2019-02-15 07:25:47 -05:00
Brad King
3411c81575 Merge topic 'try_compile-expand-compile-defs'
cde2596a19 try_compile: Restore expansion of ;-list in COMPILE_DEFINITIONS

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !2965
2019-02-15 07:19:51 -05:00
Brad King
cde2596a19 try_compile: Restore expansion of ;-list in COMPILE_DEFINITIONS
The quoting added by commit 8c5221fb1f (try_compile: Preserve special
characters in COMPILE_DEFINITIONS, 2019-01-21, v3.14.0-rc1~108^2~3)
broke the case that the `COMPILE_DEFINITIONS` value contains a `;`.
Without the quoting the `;` would be generated literally in an unquoted
argument in the test `CMakeLists.txt` file and would then be expanded.
With quoting the `;` is preserved, which is not the old behavior.

Fix this by expanding the `;`-list ahead of time.  Add test cases for
behavior with both `#` and `;`.

This was noticed with the PGI compiler where we set
`CMAKE_CXX*_STANDARD_COMPILE_OPTION` to values like `--c++17;-A`.  The
symptom had also been observed while preparing commit ef8f237686
(ParseImplicitIncludeInfo: add SunPro Fortran and PGI compiler, Cray
fix, 2019-01-29, v3.14.0-rc1~26^2~2) but was not recognized at the time
as a regression.  Revert the workaround added by that commit.

Fixes: #18919
2019-02-15 06:21:19 -05:00
Kitware Robot
a2a903fe42 CMake Nightly Date Stamp 2019-02-15 00:01:08 -05:00
Albert Astals Cid
30faf72625 Remove return from void function 2019-02-14 17:34:06 +01:00
Brad King
f510aafbfc Merge branch 'upstream-KWSys' into update-kwsys
* upstream-KWSys:
  KWSys 2019-02-14 (e270ce9f)
2019-02-14 10:55:44 -05:00
Brad King
0069825f50 Merge topic 'fortran-submodule-names'
d80ecba5c2 Fortran: Fix submodule file names across compilers
72057d9c15 Fortran: Thread compiler id through to internal Fortran parser
7ae329e2ed Fortran: Factor out .mod and .smod file name construction

Acked-by: Kitware Robot <kwrobot@kitware.com>
Acked-by: Michael Hirsch, Ph.D. <michael@scivision.co>
Merge-request: !2958
2019-02-14 10:25:15 -05:00
Brad King
d80ecba5c2 Fortran: Fix submodule file names across compilers
The naming convention for submodule files varies across compilers.  Add
a table to the compiler information modules and thread the information
through to the Fortran module dependency parser.  Fill out the table for
compiler ids known to support Fortran submodules.

Fixes: #18746
2019-02-14 10:23:02 -05:00
Brad King
72057d9c15 Fortran: Thread compiler id through to internal Fortran parser 2019-02-14 10:23:02 -05:00
Brad King
7ae329e2ed Fortran: Factor out .mod and .smod file name construction 2019-02-14 10:23:02 -05:00
Brad King
50ba2f019b Merge topic 'fix-legacy-implicit-includes'
6fc3382944 Update logic for sysroot in detected implicit include directories
2ad14ef4ea cmAlgorithms: Add cmHasPrefix to match existing cmHasSuffix
557b2d6e65 Fix regression in -I/usr/include exclusion logic
017598a444 macOS: Fix addition of <sdk>/usr/include to default implicit include dirs

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !2957
2019-02-14 10:14:47 -05:00
Brad King
fd74eba140 Merge topic 'fix-pointer-truncation'
76a5ac2100 cmListFileLexer: Add missing include to avoid possible pointer truncation

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !2956
2019-02-14 10:14:08 -05:00
Brad King
49a53cac87 Merge topic 'update-kwsys'
ec13bd5230 Tests: Disable test that builds KWSys if not also building CMake
ded4bc136e Merge branch 'upstream-KWSys' into update-kwsys
f3999a21c8 KWSys 2019-02-12 (44676809)

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !2953
2019-02-14 10:11:54 -05:00
Brad King
5c26e3c5e3 VS: Fix validation of Windows 8.1 SDK
The check added by commit 0a29a31161 (VS2017: Verify Windows 8.1 SDK
before using it, 2017-04-25, v3.8.1~2^2) used the wrong path to
`windows.h` within the SDK, leading to it never being detected.

Fixes: #18923
2019-02-14 08:25:26 -05:00
Kitware Robot
5b3683ec8a CMake Nightly Date Stamp 2019-02-14 00:01:06 -05:00
Saleem Abdulrasool
157570b5a2 Add placeholder for Swift's library name
This allows us to set the proper link name for the Swift library
(soname).  Because this needs to be passed to the object being compiled,
we need to create a new placeholder so that it can be sent along to the
frontend.  Default to the target name unless it is explicitly provided.
2019-02-13 09:25:29 -08:00
Zsolt Parragi
76a5ac2100 cmListFileLexer: Add missing include to avoid possible pointer truncation
The `cmsys/Enconding.h` include had a typo in its surrounding ifdef,
possibly causing a missing function declaration (`cmsysEncoding_DupToWide`).
As this is C code, this resulted in the code compiling, but with a truncated
return value, possibly causing crashes.
2019-02-13 10:22:59 -05:00
Brad King
63efce507b Merge topic 'names'
fc8b90af2c Create and use `cmGeneratorTarget::Names`

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !2936
2019-02-13 10:17:55 -05:00
Brad King
8914d4317a Merge topic 'systools-stdstring2'
080a79ca4a cmSystemTools: More methods accept `std::string` params

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !2952
2019-02-13 10:17:08 -05:00
Brad King
264128469d Merge topic 'cmcurses-fix-solaris-lambda-warning'
c28abdb5ac cmCursesMainForm: Fix lambda return type deducing warning

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !2955
2019-02-13 10:16:31 -05:00
Brad King
6fc3382944 Update logic for sysroot in detected implicit include directories
Since commit 5990ecb741 (Compute implicit include directories from
compiler output, 2018-12-07, v3.14.0-rc1~108^2) the values of the
`CMAKE_<LANG>_IMPLICIT_INCLUDE_DIRECTORIES` variables are computed from
a real compiler invocation.  In this case the paths under the sysroot
should already have the sysroot prefix so we should no longer have to
add the sysroot prefix.  However, it is also possible for project code
to add its own paths to `CMAKE_<LANG>_IMPLICIT_INCLUDE_DIRECTORIES`
without the sysroot prefix and expect the historical addition of the
sysroot prefix to be preserved.

Try to account for both cases by conditionally adding the sysroot prefix
on implicit include directories that do not already have it.
2019-02-13 10:03:56 -05:00
Brad King
2ad14ef4ea cmAlgorithms: Add cmHasPrefix to match existing cmHasSuffix 2019-02-13 09:52:20 -05:00
Brad King
557b2d6e65 Fix regression in -I/usr/include exclusion logic
The change in commit 15ad830062 (Refactor exclusion of -I/usr/include to
avoid per-language values, 2019-01-21, v3.14.0-rc1~108^2~4) caused the
exclusion to apply to Fortran, but it was only meant for C, CXX, and
CUDA.  The purpose of the change was to prepare for the value of
`CMAKE_<LANG>_IMPLICIT_INCLUDE_DIRECTORIES` to be computed from the
actual compiler instead of hard-coded.  We need to preserve exclusion of
`-I/usr/include` if the compiler has any implicit include directory that
looks intended to replace it, e.g. `<sdk>/usr/include` on macOS.

Fixes: #18914
2019-02-13 09:52:20 -05:00
Brad King
122946def9 Merge topic 'genex-GENEX_EVAL-fix-recursion'
e429e9af42 genex: Fix erroneous handling of recursion for $<GENEX_EVAL:>

Acked-by: Kitware Robot <kwrobot@kitware.com>
Acked-by: yrHeTaTeJlb <jjj.bo@yandex.ru>
Merge-request: !2954
2019-02-13 08:40:04 -05:00
Marc Chevrier
e429e9af42 genex: Fix erroneous handling of recursion for $<GENEX_EVAL:>
Fixes: #18894
2019-02-13 08:37:02 -05:00
Kitware Robot
99ec095d9d CMake Nightly Date Stamp 2019-02-13 00:01:06 -05:00
Artur Ryt
c28abdb5ac cmCursesMainForm: Fix lambda return type deducing warning
It was issued by sparc compiler on Solaris system
See !2947
2019-02-12 19:24:53 +01:00
Brad King
ded4bc136e Merge branch 'upstream-KWSys' into update-kwsys
* upstream-KWSys:
  KWSys 2019-02-12 (44676809)
2019-02-12 08:35:12 -05:00
Brad King
9d2ab63aaf Merge topic 'clangcl-fixes'
091afa7342 Tests: Teach tests when to treat clang-cl as MSVC
006768903c Work around clang-cl breakage on make_unique/std::forward
d625dfcdf9 Avoid compiling CMake itself as C++17 with Clang's MSVC ABI

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !2573
2019-02-12 08:31:00 -05:00
Brad King
20afd497c9 Merge topic 'progress-stdstring'
950c099d83 cmake: Progress functions use `std::string` param

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !2948
2019-02-12 08:30:13 -05:00