mirror of
https://github.com/Kitware/CMake.git
synced 2026-05-04 13:19:51 -05:00
VS/Android: Set API level explicitly during compiler identification
VS2022 defaults to API 31 in 64-bit builds. This breaks if you combine VS2022 with an older Android NDK.
This commit is contained in:
committed by
Brad King
parent
5d5b6c741d
commit
850ee280e0
@@ -345,6 +345,7 @@ Id flags: ${testflags} ${CMAKE_${lang}_COMPILER_ID_FLAGS_ALWAYS}
|
|||||||
set(id_platform ${CMAKE_VS_PLATFORM_NAME})
|
set(id_platform ${CMAKE_VS_PLATFORM_NAME})
|
||||||
set(id_lang "${lang}")
|
set(id_lang "${lang}")
|
||||||
set(id_PostBuildEvent_Command "")
|
set(id_PostBuildEvent_Command "")
|
||||||
|
set(id_api_level "")
|
||||||
if(CMAKE_VS_PLATFORM_TOOLSET MATCHES "^[Ll][Ll][Vv][Mm](_v[0-9]+(_xp)?)?$")
|
if(CMAKE_VS_PLATFORM_TOOLSET MATCHES "^[Ll][Ll][Vv][Mm](_v[0-9]+(_xp)?)?$")
|
||||||
set(id_cl_var "ClangClExecutable")
|
set(id_cl_var "ClangClExecutable")
|
||||||
elseif(CMAKE_VS_PLATFORM_TOOLSET MATCHES "^[Cc][Ll][Aa][Nn][Gg]([Cc][Ll]$|_[0-9])")
|
elseif(CMAKE_VS_PLATFORM_TOOLSET MATCHES "^[Cc][Ll][Aa][Nn][Gg]([Cc][Ll]$|_[0-9])")
|
||||||
@@ -430,6 +431,7 @@ Id flags: ${testflags} ${CMAKE_${lang}_COMPILER_ID_FLAGS_ALWAYS}
|
|||||||
set(id_system "")
|
set(id_system "")
|
||||||
endif()
|
endif()
|
||||||
if(id_keyword STREQUAL "Android")
|
if(id_keyword STREQUAL "Android")
|
||||||
|
set(id_api_level "<AndroidAPILevel>android-${CMAKE_SYSTEM_VERSION}</AndroidAPILevel>")
|
||||||
if(CMAKE_GENERATOR MATCHES "Visual Studio 14")
|
if(CMAKE_GENERATOR MATCHES "Visual Studio 14")
|
||||||
set(id_system_version "<ApplicationTypeRevision>2.0</ApplicationTypeRevision>")
|
set(id_system_version "<ApplicationTypeRevision>2.0</ApplicationTypeRevision>")
|
||||||
elseif(CMAKE_GENERATOR MATCHES "Visual Studio 1[567]")
|
elseif(CMAKE_GENERATOR MATCHES "Visual Studio 1[567]")
|
||||||
|
|||||||
@@ -26,6 +26,7 @@
|
|||||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|@id_platform@'" Label="Configuration">
|
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|@id_platform@'" Label="Configuration">
|
||||||
<ConfigurationType>@id_config_type@</ConfigurationType>
|
<ConfigurationType>@id_config_type@</ConfigurationType>
|
||||||
@id_toolset@
|
@id_toolset@
|
||||||
|
@id_api_level@
|
||||||
<CharacterSet>MultiByte</CharacterSet>
|
<CharacterSet>MultiByte</CharacterSet>
|
||||||
</PropertyGroup>
|
</PropertyGroup>
|
||||||
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
|
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
|
||||||
|
|||||||
Reference in New Issue
Block a user