Skip to content

Commit

Permalink
Adding CMakePresets support for O3DE. (o3de#9037)
Browse files Browse the repository at this point in the history
The host platforms of Windows, Linux and MacOS has added support for
configure, build and test presets.
The non-host platforms of iOS and Android has supported for configure
and build presets.

Signed-off-by: lumberyard-employee-dm <[email protected]>

Filled out the CMakePresets configuration, build and test presets for all platforms.

A monolithic and non-monolithic preset has been added to each platform along with a unity/no-unity build preset and presets for the de-facto build generators for each platform.

The host platforms in addition have build presets for the Editor, AssetProcessor and the test suites of smoke and main.
Furthermore a test preset has been addded to run those test.

Signed-off-by: lumberyard-employee-dm <[email protected]>
  • Loading branch information
lemonade-dm authored Apr 21, 2022
1 parent 2ff326e commit 442bc3d
Show file tree
Hide file tree
Showing 11 changed files with 1,852 additions and 0 deletions.
18 changes: 18 additions & 0 deletions CMakePresets.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
{
"version": 4,
"cmakeMinimumRequired": {
"major": 3,
"minor": 23,
"patch": 0
},
"include": [
"cmake/Platform/Android/CMakePresets.json",
"cmake/Platform/iOS/CMakePresets.json",
"cmake/Platform/Linux/CMakePresets.json",
"cmake/Platform/Mac/CMakePresets.json",
"cmake/Platform/Windows/CMakePresets.json"
],
"configurePresets": [],
"buildPresets": [],
"testPresets": []
}
1 change: 1 addition & 0 deletions Templates/DefaultProject/Template/.gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -3,3 +3,4 @@
[Uu]ser/
[Uu]ser_test*/
_savebackup/
CMakeUserPresets.json
8 changes: 8 additions & 0 deletions Templates/DefaultProject/Template/CMakePresets.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
{
"version": 4,
"cmakeMinimumRequired": {
"major": 3,
"minor": 23,
"patch": 0
}
}
1 change: 1 addition & 0 deletions Templates/MinimalProject/Template/.gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -2,3 +2,4 @@
[Cc]ache/
[Uu]ser/
_savebackup/
CMakeUserPresets.json
8 changes: 8 additions & 0 deletions Templates/MinimalProject/Template/CMakePresets.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
{
"version": 4,
"cmakeMinimumRequired": {
"major": 3,
"minor": 23,
"patch": 0
}
}
256 changes: 256 additions & 0 deletions cmake/Platform/Android/CMakePresets.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,256 @@
{
"version": 4,
"cmakeMinimumRequired": {
"major": 3,
"minor": 23,
"patch": 0
},
"include": [
"../Common/CMakePresets.json"
],
"configurePresets": [
{
"name": "android-default",
"displayName": "Android",
"description": "Android default configuration",
"toolchainFile": "${sourceDir}/cmake/Platform/Android/Toolchain_android.cmake",
"inherits": [
"android-ninja",
"android-unity",
"android-non-monolithic"
],
"condition": {
"type": "inList",
"string": "${hostSystemName}",
"list": [
"Darwin",
"Linux",
"Windows"
]
}
},
{
"name": "android-mono-default",
"displayName": "Android Monolithic with Unity and Ninja",
"description": "Configures Android to build the Monolithic permutation using Ninja with Unity builds",
"toolchainFile": "${sourceDir}/cmake/Platform/Android/Toolchain_android.cmake",
"inherits": [
"android-ninja",
"android-unity",
"android-monolithic"
],
"condition": {
"type": "inList",
"string": "${hostSystemName}",
"list": [
"Darwin",
"Linux",
"Windows"
]
}
},
{
"name": "android-unity",
"displayName": "Android Unity",
"description": "Android build which uses unity files",
"toolchainFile": "${sourceDir}/cmake/Platform/Android/Toolchain_android.cmake",
"binaryDir": "${sourceDir}/build/android",
"inherits": [
"unity"
],
"condition": {
"type": "inList",
"string": "${hostSystemName}",
"list": [
"Darwin",
"Linux",
"Windows"
]
}
},
{
"name": "android-no-unity",
"displayName": "Android without Unity",
"description": "Android build which uses unity files",
"toolchainFile": "${sourceDir}/cmake/Platform/Android/Toolchain_android.cmake",
"binaryDir": "${sourceDir}/build/android_no_unity",
"inherits": [
"no-unity"
],
"condition": {
"type": "inList",
"string": "${hostSystemName}",
"list": [
"Darwin",
"Linux",
"Windows"
]
}
},
{
"name": "android-non-monolithic",
"displayName": "Android Non-Monolithic",
"description": "Default configuration for non-monolithic builds",
"toolchainFile": "${sourceDir}/cmake/Platform/Android/Toolchain_android.cmake",
"inherits": [
"non-monolithic"
],
"condition": {
"type": "inList",
"string": "${hostSystemName}",
"list": [
"Darwin",
"Linux",
"Windows"
]
}
},
{
"name": "android-monolithic",
"displayName": "Android Monolithic",
"description": "Default configuration for monolithic builds",
"toolchainFile": "${sourceDir}/cmake/Platform/Android/Toolchain_android.cmake",
"binaryDir": "${sourceDir}/build/android_mono",
"inherits": [
"monolithic"
],
"condition": {
"type": "inList",
"string": "${hostSystemName}",
"list": [
"Darwin",
"Linux",
"Windows"
]
}
},
{
"name": "android-ninja",
"displayName": "Android Ninja",
"description": "Configure Android using with the Ninja generator",
"toolchainFile": "${sourceDir}/cmake/Platform/Android/Toolchain_android.cmake",
"binaryDir": "${sourceDir}/build/android_ninja",
"inherits": [
"android-ninja-unity"
],
"condition": {
"type": "inList",
"string": "${hostSystemName}",
"list": [
"Darwin",
"Linux",
"Windows"
]
}
},
{
"name": "android-ninja-unity",
"displayName": "Android Ninja Unity",
"description": "Configure Android with the Ninja generator + Unity Builds",
"toolchainFile": "${sourceDir}/cmake/Platform/Android/Toolchain_android.cmake",
"binaryDir": "${sourceDir}/build/android_ninja_unity",
"inherits": [
"ninja-multi-config",
"android-unity"
],
"condition": {
"type": "inList",
"string": "${hostSystemName}",
"list": [
"Darwin",
"Linux",
"Windows"
]
}
},
{
"name": "android-ninja-no-unity",
"displayName": "Android Ninja without Unity",
"description": "Configure Android with the Ninja Generator without unity builds",
"toolchainFile": "${sourceDir}/cmake/Platform/Android/Toolchain_android.cmake",
"binaryDir": "${sourceDir}/build/android_ninja_no_unity",
"inherits": [
"ninja-multi-config",
"android-no-unity"
],
"condition": {
"type": "inList",
"string": "${hostSystemName}",
"list": [
"Darwin",
"Linux",
"Windows"
]
}
}
],
"buildPresets": [
{
"name": "android-default",
"displayName": "Android",
"description": "Builds all targets for Android",
"configurePreset": "android-default",
"condition": {
"type": "inList",
"string": "${hostSystemName}",
"list": [
"Darwin",
"Linux",
"Windows"
]
}
},
{
"name": "android-install",
"displayName": "Android install",
"description": "Builds the \"install\" target for Android, which builds all target and runs the CMake --install step",
"configurePreset": "android-default",
"inherits": [
"install"
],
"condition": {
"type": "inList",
"string": "${hostSystemName}",
"list": [
"Darwin",
"Linux",
"Windows"
]
}
},
{
"name": "android-mono-default",
"displayName": "Android Monolithic",
"description": "Builds all targets for Android in the monolithic permutation",
"configurePreset": "android-mono-default",
"condition": {
"type": "inList",
"string": "${hostSystemName}",
"list": [
"Darwin",
"Linux",
"Windows"
]
}
},
{
"name": "android-mono-install",
"displayName": "Android Monolithic install",
"description": "Builds the \"install\" target for android monolithic permutation, which builds all target and runs the CMake --install step",
"configurePreset": "android-mono-default",
"inherits": [
"install"
],
"condition": {
"type": "inList",
"string": "${hostSystemName}",
"list": [
"Darwin",
"Linux",
"Windows"
]
}
}
],
"testPresets": []
}
Loading

0 comments on commit 442bc3d

Please sign in to comment.