Commit Graph

43 Commits

Author SHA1 Message Date
Alexander Boczar
45b4b4b930 VS: Propagate CMAKE_VS_GLOBALS into compiler id projects
Issue: #19708
2019-10-17 10:18:52 -04:00
Alexander Boczar
548e9051a4 VS: Add support to override VCTargetsPath through toolset
Fixes: #19708
2019-10-15 13:28:45 -04:00
Benjamin Wozniak
0ad180d712 cuda: Extend cuda compiler detection to work with custom cuda path 2019-08-30 08:14:00 +02:00
Gregor Jasny
8af334f5ba Xcode: Derive stdlib from CXX flags
Closes: #18396
2019-02-07 06:43:51 -05:00
Gregor Jasny
e8ee8cab97 Xcode: Completely disable code signing for compiler id detection
Issue: #17870
2019-02-04 09:03:35 -05:00
Fred Baksik
72e0c115b7 GHS: Add Compiler ID detection
-- Detect GHS compiler and version
   Detect ARCHITECTURE_ID for PPC / ARM / 86 targets
   Detect PLATFORM_ID for Integrity and Integrity178 platforms
   Using defines specified in the documents for the compilers: 201416 PPC / 201754 ARM / 201714 86
-- Fallback C/CXX compiler ID to GHS if not otherwise detected and using GHS MULTI generator
   Works around issue with some GHS compilers not setting __ghs__ compiler define
-- Tweak Compiler ID checking so major id of 002017 is not replaced with 217
-- Prefer try_compile() library targets when testing for working GHS compilers
-- Avoid CMake errors if reading past end of file for checking if file is PE executable
2019-01-16 10:42:04 -05:00
Rafal Parzych
c68b358ce3 Xcode: Set CODE_SIGN_IDENTITY during compiler identification
If `CMAKE_XCODE_ATTRIBUTE_CODE_SIGN_IDENTITY` is set then propagate
it to the compiler id test project too.

Fixes: #18292
2018-08-24 13:58:51 -04:00
Brad King
bc5bcad45e Xcode: Detect architecture(s) using ARCHS instead of CURRENT_ARCH
Xcode 10 no longer populates `CURRENT_ARCH` with the current
architecture in shell scripts and instead uses `undefined_arch`.
Instead we must use `ARCHS`.  It lists all architectures separated by
spaces.

Fixes: #18085
2018-06-18 13:44:43 -04:00
Basil Fierz
5f13168419 VS: Add option to select the version of the toolset used by VS 2017
Add new `version=` parameter in the toolset setting to select the
version.  Add variable `CMAKE_VS_PLATFORM_TOOLSET_VERSION` to hold the
version, if one is set (blank indicates default).

Fixes: #17549
2018-05-29 10:12:59 -04:00
Gregor Jasny
45e30d128c Xcode: Add team to compiler-id project
Closes #16839
2017-09-19 20:44:31 +02:00
Brad King
7373b389eb Xcode: Drop support for Xcode versions below 3 2017-04-22 15:19:11 -04:00
Brad King
a122190509 Xcode: Detect CURRENT_ARCH for use by generator
During compiler identification, extract the Xcode `CURRENT_ARCH` value
and save it for later use by the Xcode generator in an internal compiler
information variable.  This will be useful to know the locations of
object files when only one architecture is built.
2017-03-31 11:26:08 -04:00
Brad King
895b890466 VS: Add more placeholders to compiler id detection project file template 2017-03-10 10:19:54 -05:00
Brad King
a650dbb280 VS: Refactor compiler id detection project file template
Make the `ClCompile` element name and `PostBuildEvent/Command` value
configurable.  Move the current content into default values for the
corresponding variables.
2017-03-10 10:19:54 -05:00
Gilles Khouzam
435cebaaa1 VS: Fix CSharp compiler identification for VS 2017
The CSharp compiler for VS 2017 has moved from `MSBuildTools` to
`RoslynTargets`.  Account for both locations giving priority to the
`MSBuildTools` location.
2017-01-31 09:00:20 -05:00
Michael Stürmer
5c6c0344d3 C# support: add compiler detection for MSVC 2016-12-15 09:16:30 -05:00
Brad King
d079e71c29 VS: Provide an option to use x64 host tools
Visual Studio provides toolchains that are themselves built for 32-bit
or 64-bit host architectures.  By default it uses the 32-bit tools, but
it can be told to prefer the 64-bit tools on 64-bit hosts.  Extend the
`CMAKE_GENERATOR_TOOLSET` specification to provide a way to request
use of the 64-bit host tools.

Closes: #15622
2016-10-14 09:22:26 -04:00
Brad King
49d50ad407 Xcode: Port rudimentary Swift support to Xcode 8
The `.pbxproj` file must now specify a `SWIFT_VERSION` value.
Set it to the legacy value of "2.3" for now.  Later this can
be made configurable (e.g. to "3.0").
2016-09-23 11:47:06 -04:00
Brad King
b42866a34a Drop Visual Studio 6 generator
This generator has been deprecated since CMake 3.3.  Remove it.
Update documentation, modules, and tests to drop content specific
to this generator.
2016-03-09 09:42:18 -05:00
Gilles Khouzam
3f077996f5 VS: Add support for selecting the Windows 10 SDK (#15670)
Teach the VS 2015 generator to produce a WindowsTargetPlatformVersion
value.  Use the CMAKE_SYSTEM_VERSION to specify the version and if not
set choose a default based on available SDKs.  Activate this behavior
when targeting Windows 10.

Co-Author: Brad King <brad.king@kitware.com>
2015-10-02 09:53:25 -04:00
Gregor Jasny
4da60024ad Swift: Fix Compiler-Id detection for Swift 2 2015-09-03 20:30:45 +02:00
Brad King
bf11253163 Add rudimentary support for the Apple Swift language with Xcode
Allow the `Swift` language to be enabled with the Xcode generator for
Xcode >= 6.1.  Reject it on other generators and with older Xcode
versions.  Since Apple is the only vendor implementing the language
right now, the compiler id can be just `Apple`.
2015-07-06 16:15:49 -04:00
Brad King
b76b52c0b4 Xcode: Set ARCHS only when CMAKE_OSX_ARCHITECTURES is specified (#14736)
Teach the Xcode generator that ONLY_ACTIVE_ARCH=YES means to use ARCHS,
and that the default of ONLY_ACTIVE_ARCH=NO means to use NATIVE_ARCH and
ignore ARCHS.  In the latter case there is no reason to generate ARCHS.
2015-03-27 10:52:32 -04:00
Brad King
7b7209f635 Xcode: Do not require code signing for compiler id (#15214)
The approach in commit v3.1.0-rc1~1^2 (Xcode: Fix compiler id detection
when code signing is required, 2014-10-22) still requires a code signing
key when targeting a real device.  Instead set CODE_SIGNING_REQUIRED to
"NO" to tell Xcode not to sign at all.  Drop the corresponding setting
of the code signing identity.
2015-01-11 16:50:39 -05:00
Brad King
b91020f659 Xcode: Fix compiler id detection when code signing is required
The iOS product type 'com.apple.package-type.bundle.unit-test' requires
code signing on Xcode 6.  Other iOS target types do too.  Until CMake
learns to add the CODE_SIGN_IDENTITY build attribute itself, toolchain
files can set CMAKE_XCODE_ATTRIBUTE_CODE_SIGN_IDENTITY to tell the Xcode
generator to add the attribute.  Teach CMakeDetermineCompilerId to
recognize this variable and add the CODE_SIGN_IDENTITY build attribute
to the compiler id project.
2014-10-22 10:16:07 -04:00
Brad King
c48f6e1229 Xcode: Fix compiler id detection for iOS tools (#15214)
Since commit 0cce556b (Xcode: Use sysroot and deployment target to
identify compiler, 2014-04-29) our compiler id detection project uses
the target platform SDK in case Xcode selects a different compiler based
on it.  Now the compiler id project actually compiles with the target
compiler and SDK when cross-compiling.

The iOS tools do not support the 'com.apple.product-type.tool' product
type we use in our compiler id detection project.  When targeting
iPhone, use product type 'com.apple.product-type.bundle.unit-test'
instead.
2014-10-22 10:16:07 -04:00
Brad King
d09b60f563 VS: Detect compiler id of Nsight Tegra-Android toolchains
Teach CMakeDetermineCompilerId to recognize the Tegra-Android platform
and generate a test project for Nsight Tegra tools.  Locate the full
path to CMAKE_<LANG>_COMPILER by computing it within the test project
build environment.

Also teach CMakeFindBinUtils that this variant of the Visual Studio
generator uses UNIX-like instead of MS-like archiving and linking tools.
2014-09-29 16:05:53 -04:00
Brad King
dbb5a7ee31 CMakeDetermineCompilerId: Fix detection for VS ARM platform
Add WindowsSDKDesktopARMSupport to the compiler id .vcxproj to
avoid 'error MSB8022: Compiling Desktop applications for the ARM
platform is not supported.' from VS.

Inspired-by: Minmin Gong <minmin.gong@gmail.com>
Inspired-by: Gilles Khouzam <gillesk@microsoft.com>
2014-08-12 10:08:37 -04:00
Gilles Khouzam
b94ddf6cd7 CMakeDetermineCompilerId: Recognize WindowsPhone and WindowsStore
When CMAKE_SYSTEM_NAME is set to target one of these, add
ApplicationType and ApplicationTypeRevision elements to the .vcxproj
file used to identify the compiler so that the WindowsPhone or
WindowsStore toolchains can work.

Co-Author: Brad King <brad.king@kitware.com>
2014-07-31 14:08:48 -04:00
Brad King
0cce556b5f Xcode: Use sysroot and deployment target to identify compiler
Use CMAKE_OSX_SYSROOT and CMAKE_OSX_DEPLOYMENT_TARGET to set the Xcode
SDKROOT and MACOSX_DEPLOYMENT_TARGET build settings.  This is necessary
because some versions of Xcode select a different compiler based on
these settings.  We need to make sure the compiler identified during
language initialization matches what will be used for the actual build.
2014-04-29 09:36:15 -04:00
Brad King
af40e8c312 VS: Detect Intel Fortran compiler id and version
Teach CMakeDetermineCompilerId to use a .vfproj project file to
build the Fortran compiler id source file under the Visual Studio
generators.
2013-10-18 09:55:59 -04:00
Patrick Gansterer
b02f09d434 VS: Replace ArchitectureId with PlatformName
Since we do not need the information about the target architecture
we can use the PlatformName only to specify the this information.
This also removes setting of the MSVC_*_ARCHITECTURE_ID variable
which is not required, because this variable gets set by the
compiler detection code in CMAKE_DETERMINE_COMPILER_ID_CHECK().
2013-08-05 13:38:26 +02:00
Patrick Gansterer
60e568cf79 VS10: Do not set the TargetMachine when detecting the compiler
The Microsoft linker is intelligent enough to detect the target
machine type depending on the input files. This allows us to
get the target architecture from the compiler instead of
maintaining the mapping to the platform name.
2013-08-05 13:38:21 +02:00
Patrick Gansterer
dfbfe6f166 VS6: Hardcode id_machine_6 for compiler detection
id_machine6 is never set to an other value than x86. So it is
safe to remove the replacements with "x86" directly.
2013-08-05 13:38:19 +02:00
Brad King
5683146185 Xcode: Use explicitFileType to mark source types (#14093)
Replace use of lastKnownFileType with explicitFileType to insist
that Xcode treat the file as we ask.
2013-04-16 15:44:48 -04:00
Brad King
f980a80495 Xcode: Implement generator toolset selection (#9831, #13802)
Implement generator toolset selection (cmake -T) for Xcode > 2.0 by
adding the GCC_VERSION build setting to project files.
2013-02-07 11:07:48 -05:00
Patrick Gansterer
6b40e1ba3e VS: Ignore LIBC.lib when linking the CompilerId executables
Some Windows CE linkers want to link against LIBC.lib, but can not
find them. Since they are not required we can simply ignore it.
2012-11-30 15:17:50 +01:00
Patrick Gansterer
8e85822e2b VS: Add the entry point when compiling for WindowsCE
Set the entry point to mainACRTStartup to make sure that main()
can be found when linking the application to check the compiler.
2012-11-30 15:15:06 +01:00
Patrick Gansterer
5bf9fd8253 VS: Set the correct SubSystem when determinating the CompilerId
Some WinCE linker only work when the subsystem is set to WINDOWSCE.
2012-11-30 14:14:27 +01:00
Patrick Gansterer
40c36c9f7b VS: Make DetermineCompilerId working with WinCE too
Add a dummy mainCRTStartup() function, since the linker searches for
it instead of main() and set the CMAKE_SYSTEM_* variables depending
on the MSVC_C_ARCHITECTURE_ID and CMAKE_VS_WINCE_VERSION variables.
2012-11-27 08:31:19 -05:00
Patrick Gansterer
14861f88d2 VS: Remove TargetMachine for linker when checking compiler id
If the TargetMachine isn't defined the linker will choose
the correct target depending on the input file. This helps
us later with additional compiler platforms for WinCE.
2012-11-20 19:15:39 +01:00
Brad King
66cb3356f5 VS: Detect the compiler id and tool location
Configure a hand-generated Visual Studio project to build the compiler id
source file since we cannot run the compiler command-line tool directly.
Add a post-build command to print out the full path to the compiler tool.
Parse the full path to the compiler tool from the build output.
2012-08-22 16:35:54 -04:00
Brad King
965a69dcaa Xcode: Detect the compiler id and tool location
Configure a hand-generated Xcode project to build the compiler id source
file since we cannot run the compiler command-line tool directly.  Add a
post-build shell script phase to print out the compiler toolset build
setting.  Run xcodebuild to compile the identification binary.  Parse
the full path to the compiler tool from the xcodebuild output.
2012-08-22 15:14:33 -04:00