-
-
Notifications
You must be signed in to change notification settings - Fork 646
Utilize existing tool version functionality for toolchainversion #2594
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
nickclark2016
merged 1 commit into
premake:master
from
nickclark2016:normalize-toolchain-versions
Jan 8, 2026
+484
−17
Merged
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,229 @@ | ||
| -- | ||
| -- tests/android/test_android_toolset.lua | ||
| -- Unit tests for Visual Studio Android toolset handling. | ||
| -- Author: Nick Clark | ||
| -- Copyright (c) 2026 Jess Perkins and the Premake project | ||
| -- | ||
|
|
||
| local p = premake | ||
| local suite = test.declare("test_android_toolset") | ||
| local vc2010 = p.vstudio.vc2010 | ||
|
|
||
|
|
||
| -- | ||
| -- Setup | ||
| -- | ||
|
|
||
| local wks, prj | ||
|
|
||
| function suite.setup() | ||
| p.action.set("vs2015") | ||
| system "android" | ||
| architecture "ARM" | ||
| wks, prj = test.createWorkspace() | ||
| end | ||
|
|
||
| local function prepareConfigProperties() | ||
| system "android" | ||
| local cfg = test.getconfig(prj, "Debug", platform) | ||
| vc2010.configurationProperties(cfg) | ||
| end | ||
|
|
||
| -- | ||
| -- Test Android GCC 4.6 toolchain mapping. | ||
| -- | ||
|
|
||
| function suite.androidGcc46Toolchain() | ||
| toolset "gcc-4.6" | ||
| prepareConfigProperties() | ||
| test.capture [[ | ||
| <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|ARM'" Label="Configuration"> | ||
| <ConfigurationType>Application</ConfigurationType> | ||
| <PlatformToolset>GCC_4_6</PlatformToolset> | ||
| ]] | ||
| end | ||
|
|
||
| function suite.androidGcc46ToolsetVersion() | ||
| toolset "gcc" | ||
| toolchainversion "4.6" | ||
| prepareConfigProperties() | ||
| test.capture [[ | ||
| <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|ARM'" Label="Configuration"> | ||
| <ConfigurationType>Application</ConfigurationType> | ||
| <PlatformToolset>GCC_4_6</PlatformToolset> | ||
| ]] | ||
| end | ||
|
|
||
| -- | ||
| -- Test Android GCC 4.8 toolchain mapping. | ||
| -- | ||
|
|
||
| function suite.androidGcc48Toolchain() | ||
| toolset "gcc-4.8" | ||
| prepareConfigProperties() | ||
| test.capture [[ | ||
| <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|ARM'" Label="Configuration"> | ||
| <ConfigurationType>Application</ConfigurationType> | ||
| <PlatformToolset>GCC_4_8</PlatformToolset> | ||
| ]] | ||
| end | ||
|
|
||
| function suite.androidGcc48ToolsetVersion() | ||
| toolset "gcc" | ||
| toolchainversion "4.8" | ||
| prepareConfigProperties() | ||
| test.capture [[ | ||
| <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|ARM'" Label="Configuration"> | ||
| <ConfigurationType>Application</ConfigurationType> | ||
| <PlatformToolset>GCC_4_8</PlatformToolset> | ||
| ]] | ||
| end | ||
|
|
||
| -- | ||
| -- Test Android GCC 4.9 toolchain mapping. | ||
| -- | ||
|
|
||
| function suite.androidGcc49Toolchain() | ||
| toolset "gcc-4.9" | ||
| prepareConfigProperties() | ||
| test.capture [[ | ||
| <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|ARM'" Label="Configuration"> | ||
| <ConfigurationType>Application</ConfigurationType> | ||
| <PlatformToolset>GCC_4_9</PlatformToolset> | ||
| ]] | ||
| end | ||
|
|
||
| function suite.androidGcc49ToolsetVersion() | ||
| toolset "gcc" | ||
| toolchainversion "4.9" | ||
| prepareConfigProperties() | ||
| test.capture [[ | ||
| <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|ARM'" Label="Configuration"> | ||
| <ConfigurationType>Application</ConfigurationType> | ||
| <PlatformToolset>GCC_4_9</PlatformToolset> | ||
| ]] | ||
| end | ||
|
|
||
| -- | ||
| -- Test Android Clang 3.4 toolchain mapping. | ||
| -- | ||
| function suite.androidClang34Toolchain() | ||
| toolset "clang-3.4" | ||
| prepareConfigProperties() | ||
| test.capture [[ | ||
| <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|ARM'" Label="Configuration"> | ||
| <ConfigurationType>Application</ConfigurationType> | ||
| <PlatformToolset>Clang_3_4</PlatformToolset> | ||
| ]] | ||
| end | ||
|
|
||
| function suite.androidClang34ToolsetVersion() | ||
| toolset "clang" | ||
| toolchainversion "3.4" | ||
| prepareConfigProperties() | ||
| test.capture [[ | ||
| <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|ARM'" Label="Configuration"> | ||
| <ConfigurationType>Application</ConfigurationType> | ||
| <PlatformToolset>Clang_3_4</PlatformToolset> | ||
| ]] | ||
| end | ||
|
|
||
| -- | ||
| -- Test Android Clang 3.5 toolchain mapping. | ||
| -- | ||
|
|
||
| function suite.androidClang35Toolchain() | ||
| toolset "clang-3.5" | ||
| prepareConfigProperties() | ||
| test.capture [[ | ||
| <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|ARM'" Label="Configuration"> | ||
| <ConfigurationType>Application</ConfigurationType> | ||
| <PlatformToolset>Clang_3_5</PlatformToolset> | ||
| ]] | ||
| end | ||
|
|
||
| function suite.androidClang35ToolsetVersion() | ||
| toolset "clang" | ||
| toolchainversion "3.5" | ||
| prepareConfigProperties() | ||
| test.capture [[ | ||
| <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|ARM'" Label="Configuration"> | ||
| <ConfigurationType>Application</ConfigurationType> | ||
| <PlatformToolset>Clang_3_5</PlatformToolset> | ||
| ]] | ||
| end | ||
|
|
||
| -- | ||
| -- Test Android Clang 3.6 toolchain mapping. | ||
| -- | ||
|
|
||
| function suite.androidClang36Toolchain() | ||
| toolset "clang-3.6" | ||
| prepareConfigProperties() | ||
| test.capture [[ | ||
| <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|ARM'" Label="Configuration"> | ||
| <ConfigurationType>Application</ConfigurationType> | ||
| <PlatformToolset>Clang_3_6</PlatformToolset> | ||
| ]] | ||
| end | ||
|
|
||
| function suite.androidClang36ToolsetVersion() | ||
| toolset "clang" | ||
| toolchainversion "3.6" | ||
| prepareConfigProperties() | ||
| test.capture [[ | ||
| <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|ARM'" Label="Configuration"> | ||
| <ConfigurationType>Application</ConfigurationType> | ||
| <PlatformToolset>Clang_3_6</PlatformToolset> | ||
| ]] | ||
| end | ||
|
|
||
| -- | ||
| -- Test Android Clang 3.8 toolchain mapping. | ||
| -- | ||
|
|
||
| function suite.androidClang38Toolchain() | ||
| toolset "clang-3.8" | ||
| prepareConfigProperties() | ||
| test.capture [[ | ||
| <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|ARM'" Label="Configuration"> | ||
| <ConfigurationType>Application</ConfigurationType> | ||
| <PlatformToolset>Clang_3_8</PlatformToolset> | ||
| ]] | ||
| end | ||
|
|
||
| function suite.androidClang38ToolsetVersion() | ||
| toolset "clang" | ||
| toolchainversion "3.8" | ||
| prepareConfigProperties() | ||
| test.capture [[ | ||
| <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|ARM'" Label="Configuration"> | ||
| <ConfigurationType>Application</ConfigurationType> | ||
| <PlatformToolset>Clang_3_8</PlatformToolset> | ||
| ]] | ||
| end | ||
|
|
||
| -- | ||
| -- Test Android Clang 5.0 toolchain mapping. | ||
| -- | ||
|
|
||
| function suite.androidClang50Toolchain() | ||
| toolset "clang-5.0" | ||
| prepareConfigProperties() | ||
| test.capture [[ | ||
| <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|ARM'" Label="Configuration"> | ||
| <ConfigurationType>Application</ConfigurationType> | ||
| <PlatformToolset>Clang_5_0</PlatformToolset> | ||
| ]] | ||
| end | ||
|
|
||
| function suite.androidClang50ToolsetVersion() | ||
| toolset "clang" | ||
| toolchainversion "5.0" | ||
| prepareConfigProperties() | ||
| test.capture [[ | ||
| <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|ARM'" Label="Configuration"> | ||
| <ConfigurationType>Application</ConfigurationType> | ||
| <PlatformToolset>Clang_5_0</PlatformToolset> | ||
| ]] | ||
| end |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I guess the flexibility of this approach is that if there is ever a Remote_GCC_1_1 we can always extend this to gcc-remote-1.1 or whatever