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.
This commit is contained in:
parent
2f071466eb
commit
d09b60f563
|
@ -142,7 +142,17 @@ Id flags: ${testflags}
|
||||||
set(id_platform ${CMAKE_VS_PLATFORM_NAME})
|
set(id_platform ${CMAKE_VS_PLATFORM_NAME})
|
||||||
set(id_lang "${lang}")
|
set(id_lang "${lang}")
|
||||||
set(id_cl cl.exe)
|
set(id_cl cl.exe)
|
||||||
if(lang STREQUAL Fortran)
|
if(CMAKE_VS_PLATFORM_NAME STREQUAL "Tegra-Android")
|
||||||
|
set(v NsightTegra)
|
||||||
|
set(ext vcxproj)
|
||||||
|
if(lang STREQUAL CXX)
|
||||||
|
set(id_gcc g++)
|
||||||
|
set(id_clang clang++)
|
||||||
|
else()
|
||||||
|
set(id_gcc gcc)
|
||||||
|
set(id_clang clang)
|
||||||
|
endif()
|
||||||
|
elseif(lang STREQUAL Fortran)
|
||||||
set(v Intel)
|
set(v Intel)
|
||||||
set(ext vfproj)
|
set(ext vfproj)
|
||||||
set(id_cl ifort.exe)
|
set(id_cl ifort.exe)
|
||||||
|
@ -161,9 +171,13 @@ Id flags: ${testflags}
|
||||||
set(id_platform ia64)
|
set(id_platform ia64)
|
||||||
endif()
|
endif()
|
||||||
if(CMAKE_VS_PLATFORM_TOOLSET)
|
if(CMAKE_VS_PLATFORM_TOOLSET)
|
||||||
set(id_toolset "<PlatformToolset>${CMAKE_VS_PLATFORM_TOOLSET}</PlatformToolset>")
|
if(CMAKE_VS_PLATFORM_NAME STREQUAL "Tegra-Android")
|
||||||
if(CMAKE_VS_PLATFORM_TOOLSET MATCHES "Intel")
|
set(id_toolset "<NdkToolchainVersion>${CMAKE_VS_PLATFORM_TOOLSET}</NdkToolchainVersion>")
|
||||||
set(id_cl icl.exe)
|
else()
|
||||||
|
set(id_toolset "<PlatformToolset>${CMAKE_VS_PLATFORM_TOOLSET}</PlatformToolset>")
|
||||||
|
if(CMAKE_VS_PLATFORM_TOOLSET MATCHES "Intel")
|
||||||
|
set(id_cl icl.exe)
|
||||||
|
endif()
|
||||||
endif()
|
endif()
|
||||||
else()
|
else()
|
||||||
set(id_toolset "")
|
set(id_toolset "")
|
||||||
|
|
|
@ -35,7 +35,8 @@ if("${CMAKE_C_SIMULATE_ID}" STREQUAL "MSVC"
|
||||||
OR "${CMAKE_Fortran_SIMULATE_ID}" STREQUAL "MSVC"
|
OR "${CMAKE_Fortran_SIMULATE_ID}" STREQUAL "MSVC"
|
||||||
OR "${CMAKE_C_COMPILER_ID}" STREQUAL "MSVC"
|
OR "${CMAKE_C_COMPILER_ID}" STREQUAL "MSVC"
|
||||||
OR "${CMAKE_CXX_COMPILER_ID}" STREQUAL "MSVC"
|
OR "${CMAKE_CXX_COMPILER_ID}" STREQUAL "MSVC"
|
||||||
OR "${CMAKE_GENERATOR}" MATCHES "Visual Studio")
|
OR ("${CMAKE_GENERATOR}" MATCHES "Visual Studio"
|
||||||
|
AND NOT CMAKE_VS_PLATFORM_NAME STREQUAL "Tegra-Android"))
|
||||||
|
|
||||||
find_program(CMAKE_LINKER NAMES link HINTS ${_CMAKE_TOOLCHAIN_LOCATION})
|
find_program(CMAKE_LINKER NAMES link HINTS ${_CMAKE_TOOLCHAIN_LOCATION})
|
||||||
|
|
||||||
|
|
|
@ -0,0 +1,56 @@
|
||||||
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
|
<Project DefaultTargets="Build" ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
||||||
|
<PropertyGroup Label="NsightTegraProject">
|
||||||
|
<NsightTegraProjectRevisionNumber>6</NsightTegraProjectRevisionNumber>
|
||||||
|
</PropertyGroup>
|
||||||
|
<ItemGroup Label="ProjectConfigurations">
|
||||||
|
<ProjectConfiguration Include="Debug|@id_platform@">
|
||||||
|
<Configuration>Debug</Configuration>
|
||||||
|
<Platform>@id_platform@</Platform>
|
||||||
|
</ProjectConfiguration>
|
||||||
|
</ItemGroup>
|
||||||
|
<PropertyGroup Label="Globals">
|
||||||
|
<ProjectGuid>{CAE07175-D007-4FC3-BFE8-47B392814159}</ProjectGuid>
|
||||||
|
<RootNamespace>CompilerId@id_lang@</RootNamespace>
|
||||||
|
</PropertyGroup>
|
||||||
|
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
|
||||||
|
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|@id_platform@'" Label="Configuration">
|
||||||
|
<ConfigurationType>StaticLibrary</ConfigurationType>
|
||||||
|
@id_toolset@
|
||||||
|
</PropertyGroup>
|
||||||
|
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
|
||||||
|
<PropertyGroup>
|
||||||
|
<_ProjectFileVersion>10.0.30319.1</_ProjectFileVersion>
|
||||||
|
<OutDir Condition="'$(Configuration)|$(Platform)'=='Debug|@id_platform@'">.\</OutDir>
|
||||||
|
<IntDir Condition="'$(Configuration)|$(Platform)'=='Debug|@id_platform@'">$(Configuration)\</IntDir>
|
||||||
|
<LinkIncremental Condition="'$(Configuration)|$(Platform)'=='Debug|@id_platform@'">false</LinkIncremental>
|
||||||
|
</PropertyGroup>
|
||||||
|
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|@id_platform@'">
|
||||||
|
<ClCompile>
|
||||||
|
<PreprocessorDefinitions>%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||||
|
</ClCompile>
|
||||||
|
<Link>
|
||||||
|
</Link>
|
||||||
|
<PostBuildEvent>
|
||||||
|
<Command>
|
||||||
|
if "$(ToolchainName)"=="gcc" (
|
||||||
|
for %%i in ($(ToolchainPrebuiltRoot)\bin\*@id_gcc@.exe) do (
|
||||||
|
@echo CMAKE_@id_lang@_COMPILER=%%i
|
||||||
|
goto :done
|
||||||
|
)
|
||||||
|
)
|
||||||
|
if "$(ToolchainName)"=="clang" (
|
||||||
|
for %%i in ($(ToolchainPrebuiltRoot)\bin\*@id_clang@.exe) do (
|
||||||
|
@echo CMAKE_@id_lang@_COMPILER=%%i
|
||||||
|
goto :done
|
||||||
|
)
|
||||||
|
)
|
||||||
|
:done
|
||||||
|
</Command>
|
||||||
|
</PostBuildEvent>
|
||||||
|
</ItemDefinitionGroup>
|
||||||
|
<ItemGroup>
|
||||||
|
<ClCompile Include="@id_src@" />
|
||||||
|
</ItemGroup>
|
||||||
|
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
|
||||||
|
</Project>
|
Loading…
Reference in New Issue