diff --git a/.gitignore b/.gitignore index 9727ed1dc9..6a8700dd23 100644 --- a/.gitignore +++ b/.gitignore @@ -380,3 +380,6 @@ sdkconfig CMakeUserPresets.json config/user-tools-repos.json config/user-prefs.json + +# ccache cache files +.ccache/ diff --git a/CMake/Modules/STM32_CubePackage.cmake b/CMake/Modules/STM32_CubePackage.cmake index ca2d0f1524..22aa7d57ab 100644 --- a/CMake/Modules/STM32_CubePackage.cmake +++ b/CMake/Modules/STM32_CubePackage.cmake @@ -153,13 +153,13 @@ macro(ProcessSTM32CubePackage) endif() FetchContent_GetProperties(stm32${TARGET_SERIES_SHORT_LOWER}_hal_driver) - FetchContent_Populate(stm32${TARGET_SERIES_SHORT_LOWER}_hal_driver) + FetchContent_MakeAvailable(stm32${TARGET_SERIES_SHORT_LOWER}_hal_driver) FetchContent_GetProperties(cmsis_device_${TARGET_SERIES_SHORT_LOWER}) - FetchContent_Populate(cmsis_device_${TARGET_SERIES_SHORT_LOWER}) + FetchContent_MakeAvailable(cmsis_device_${TARGET_SERIES_SHORT_LOWER}) FetchContent_GetProperties(cmsis_core) - FetchContent_Populate(cmsis_core) + FetchContent_MakeAvailable(cmsis_core) endmacro() diff --git a/CMake/binutils.common.cmake b/CMake/binutils.common.cmake index 552ab97641..1726bec69c 100644 --- a/CMake/binutils.common.cmake +++ b/CMake/binutils.common.cmake @@ -743,7 +743,7 @@ function(nf_add_mbedtls_library) FetchContent_GetProperties(mbedtls) if(NOT mbedtls_POPULATED) # Fetch the content using previously declared details - FetchContent_Populate(mbedtls) + FetchContent_MakeAvailable(mbedtls) endif() # don't include tests or programs, only build libraries @@ -803,7 +803,7 @@ function(nf_add_lwip_library) if(NOT lwip_POPULATED) # Fetch the content using previously declared details - FetchContent_Populate(lwip) + FetchContent_MakeAvailable(lwip) endif() endfunction() diff --git a/azure-pipelines-nightly.yml b/azure-pipelines-nightly.yml index 0b346bc36f..531f211b19 100644 --- a/azure-pipelines-nightly.yml +++ b/azure-pipelines-nightly.yml @@ -296,6 +296,7 @@ jobs: REVISION: $[counter('STM32_1_10_0_versioncounter', 0)] HelperPackageVersion: $[counter('HelperPackageVersioncounter', 0)] TargetPlatform: "stm32" + CCACHE_DIR: $(Build.SourcesDirectory)/nf-interpreter/.ccache steps: - template: azure-pipelines-templates/build-preparations.yml @@ -304,6 +305,7 @@ jobs: - template: azure-pipelines-templates/download-install-ninja.yml - template: azure-pipelines-templates/download-srecord.yml - template: azure-pipelines-templates/download-hexdfu.yml + - template: azure-pipelines-templates/download-ccache.yml - template: azure-pipelines-templates/build-chibios-stm32-targets.yml - template: azure-pipelines-templates/pack-publish-artifacts.yml - template: azure-pipelines-templates/publish-cloudsmith.yml @@ -546,6 +548,8 @@ jobs: # creates a counter and assigns it to the revision variable REVISION: $[counter('ESP32_1_10_0_versioncounter', 0)] IDF_PATH: "D:/a/1/s/esp-idf" + IDF_CCACHE_ENABLE: "1" + CCACHE_DIR: $(Build.SourcesDirectory)/nf-interpreter/.ccache PIP_CACHE_DIR: $(Pipeline.Workspace)/.pip TargetPlatform: "esp32" @@ -629,6 +633,7 @@ jobs: - template: azure-pipelines-templates/nb-gitversioning.yml - template: azure-pipelines-templates/download-install-arm-gcc-toolchain.yml - template: azure-pipelines-templates/download-install-ninja.yml + - template: azure-pipelines-templates/download-ccache.yml - template: azure-pipelines-templates/build-ti-simplelink-targets.yml - template: azure-pipelines-templates/pack-publish-artifacts.yml - template: azure-pipelines-templates/publish-cloudsmith.yml @@ -682,6 +687,7 @@ jobs: - template: azure-pipelines-templates/download-install-ninja.yml - template: azure-pipelines-templates/download-hexdfu.yml - template: azure-pipelines-templates/download-srecord.yml + - template: azure-pipelines-templates/download-ccache.yml - template: azure-pipelines-templates/build-azurertos-targets.yml - template: azure-pipelines-templates/pack-publish-artifacts.yml - template: azure-pipelines-templates/publish-cloudsmith.yml diff --git a/azure-pipelines-templates/build-azurertos-targets.yml b/azure-pipelines-templates/build-azurertos-targets.yml index fb4f3db41f..de4309b369 100644 --- a/azure-pipelines-templates/build-azurertos-targets.yml +++ b/azure-pipelines-templates/build-azurertos-targets.yml @@ -11,32 +11,39 @@ steps: parameters: repoDirectory: ${{ parameters.repoDirectory }} + - task: Cache@2 + displayName: Cache ccache files + inputs: + key: 'ccache-azurertos | 0' + path: $(Build.SourcesDirectory)/nf-interpreter/.ccache + cacheHitVar: CCACHE_RESTORED + - task: CMake@1 displayName: Setup CMake (DFU, no SRecord) condition: and(eq(variables['NeedsDFU'], true), eq(variables['NeedsSRECORD'], 'false')) inputs: - cmakeArgs: "--preset $(CMakePreset) -DCMAKE_BUILD_TYPE=MinSizeRel -DBUILD_VERSION=$(NBGV_VersionMajor).$(NBGV_VersionMinor).$(NBGV_BuildNumber).$(TARGET_BUILD_COUNTER) -DTARGET_NAME=$(TargetPublishName) -DTOOL_HEX2DFU_PREFIX=$(HEX2DFU_PATH) $(BuildOptions) " + cmakeArgs: "--preset $(CMakePreset) -DCMAKE_C_COMPILER_LAUNCHER=ccache -DCMAKE_CXX_COMPILER_LAUNCHER=ccache -DCMAKE_BUILD_TYPE=MinSizeRel -DBUILD_VERSION=$(NBGV_VersionMajor).$(NBGV_VersionMinor).$(NBGV_BuildNumber).$(TARGET_BUILD_COUNTER) -DTARGET_NAME=$(TargetPublishName) -DTOOL_HEX2DFU_PREFIX=$(HEX2DFU_PATH) $(BuildOptions) " workingDirectory: ${{ parameters.repoDirectory }} - task: CMake@1 displayName: Setup CMake build (SRecord, no DFU) condition: and(eq(variables['NeedsSRECORD'], true), eq(variables['NeedsDFU'], false)) inputs: - cmakeArgs: "--preset $(CMakePreset) -DCMAKE_BUILD_TYPE=MinSizeRel -DBUILD_VERSION=$(NBGV_VersionMajor).$(NBGV_VersionMinor).$(NBGV_BuildNumber).$(TARGET_BUILD_COUNTER) -DTARGET_NAME=$(TargetPublishName) -DTOOL_SRECORD_PREFIX=$(SRECORD_PATH)/srecord/ $(BuildOptions) " + cmakeArgs: "--preset $(CMakePreset) -DCMAKE_C_COMPILER_LAUNCHER=ccache -DCMAKE_CXX_COMPILER_LAUNCHER=ccache -DCMAKE_BUILD_TYPE=MinSizeRel -DBUILD_VERSION=$(NBGV_VersionMajor).$(NBGV_VersionMinor).$(NBGV_BuildNumber).$(TARGET_BUILD_COUNTER) -DTARGET_NAME=$(TargetPublishName) -DTOOL_SRECORD_PREFIX=$(SRECORD_PATH)/srecord/ $(BuildOptions) " workingDirectory: ${{ parameters.repoDirectory }} - task: CMake@1 displayName: Setup CMake build (DFU and SRecord) condition: and(eq(variables['NeedsDFU'], true), eq(variables['NeedsSRECORD'], true)) inputs: - cmakeArgs: "--preset $(CMakePreset) -DCMAKE_BUILD_TYPE=MinSizeRel -DBUILD_VERSION=$(NBGV_VersionMajor).$(NBGV_VersionMinor).$(NBGV_BuildNumber).$(TARGET_BUILD_COUNTER) -DTARGET_NAME=$(TargetPublishName) -DTOOL_HEX2DFU_PREFIX=$(HEX2DFU_PATH) -DTOOL_SRECORD_PREFIX=$(SRECORD_PATH)/srecord/ $(BuildOptions) " + cmakeArgs: "--preset $(CMakePreset) -DCMAKE_C_COMPILER_LAUNCHER=ccache -DCMAKE_CXX_COMPILER_LAUNCHER=ccache -DCMAKE_BUILD_TYPE=MinSizeRel -DBUILD_VERSION=$(NBGV_VersionMajor).$(NBGV_VersionMinor).$(NBGV_BuildNumber).$(TARGET_BUILD_COUNTER) -DTARGET_NAME=$(TargetPublishName) -DTOOL_HEX2DFU_PREFIX=$(HEX2DFU_PATH) -DTOOL_SRECORD_PREFIX=$(SRECORD_PATH)/srecord/ $(BuildOptions) " workingDirectory: ${{ parameters.repoDirectory }} - task: CMake@1 displayName: Setup CMake build (no DFU, no SRecord) condition: and(eq(variables['NeedsDFU'], false), eq(variables['NeedsSRECORD'], false)) inputs: - cmakeArgs: "--preset $(CMakePreset) -DCMAKE_BUILD_TYPE=MinSizeRel -DBUILD_VERSION=$(NBGV_VersionMajor).$(NBGV_VersionMinor).$(NBGV_BuildNumber).$(TARGET_BUILD_COUNTER) -DTARGET_NAME=$(TargetPublishName) $(BuildOptions) " + cmakeArgs: "--preset $(CMakePreset) -DCMAKE_C_COMPILER_LAUNCHER=ccache -DCMAKE_CXX_COMPILER_LAUNCHER=ccache -DCMAKE_BUILD_TYPE=MinSizeRel -DBUILD_VERSION=$(NBGV_VersionMajor).$(NBGV_VersionMinor).$(NBGV_BuildNumber).$(TARGET_BUILD_COUNTER) -DTARGET_NAME=$(TargetPublishName) $(BuildOptions) " workingDirectory: ${{ parameters.repoDirectory }} - task: CMake@1 @@ -44,3 +51,9 @@ steps: inputs: cmakeArgs: "--build --preset $(CMakePreset) --target all --config MinSizeRel" workingDirectory: ${{ parameters.repoDirectory }} + + - task: Cache@2 + displayName: Save ccache files + inputs: + key: 'ccache-azurertos | 0' + path: $(Build.SourcesDirectory)/nf-interpreter/.ccache diff --git a/azure-pipelines-templates/build-chibios-stm32-targets.yml b/azure-pipelines-templates/build-chibios-stm32-targets.yml index fb4f3db41f..54056352cf 100644 --- a/azure-pipelines-templates/build-chibios-stm32-targets.yml +++ b/azure-pipelines-templates/build-chibios-stm32-targets.yml @@ -11,32 +11,39 @@ steps: parameters: repoDirectory: ${{ parameters.repoDirectory }} + - task: Cache@2 + displayName: Cache ccache files + inputs: + key: 'ccache-chibios | 0' + path: $(Build.SourcesDirectory)/nf-interpreter/.ccache + cacheHitVar: CCACHE_RESTORED + - task: CMake@1 displayName: Setup CMake (DFU, no SRecord) condition: and(eq(variables['NeedsDFU'], true), eq(variables['NeedsSRECORD'], 'false')) inputs: - cmakeArgs: "--preset $(CMakePreset) -DCMAKE_BUILD_TYPE=MinSizeRel -DBUILD_VERSION=$(NBGV_VersionMajor).$(NBGV_VersionMinor).$(NBGV_BuildNumber).$(TARGET_BUILD_COUNTER) -DTARGET_NAME=$(TargetPublishName) -DTOOL_HEX2DFU_PREFIX=$(HEX2DFU_PATH) $(BuildOptions) " + cmakeArgs: "--preset $(CMakePreset) -DCMAKE_C_COMPILER_LAUNCHER=ccache -DCMAKE_CXX_COMPILER_LAUNCHER=ccache -DCMAKE_BUILD_TYPE=MinSizeRel -DBUILD_VERSION=$(NBGV_VersionMajor).$(NBGV_VersionMinor).$(NBGV_BuildNumber).$(TARGET_BUILD_COUNTER) -DTARGET_NAME=$(TargetPublishName) -DTOOL_HEX2DFU_PREFIX=$(HEX2DFU_PATH) $(BuildOptions) " workingDirectory: ${{ parameters.repoDirectory }} - task: CMake@1 displayName: Setup CMake build (SRecord, no DFU) condition: and(eq(variables['NeedsSRECORD'], true), eq(variables['NeedsDFU'], false)) inputs: - cmakeArgs: "--preset $(CMakePreset) -DCMAKE_BUILD_TYPE=MinSizeRel -DBUILD_VERSION=$(NBGV_VersionMajor).$(NBGV_VersionMinor).$(NBGV_BuildNumber).$(TARGET_BUILD_COUNTER) -DTARGET_NAME=$(TargetPublishName) -DTOOL_SRECORD_PREFIX=$(SRECORD_PATH)/srecord/ $(BuildOptions) " + cmakeArgs: "--preset $(CMakePreset) -DCMAKE_C_COMPILER_LAUNCHER=ccache -DCMAKE_CXX_COMPILER_LAUNCHER=ccache -DCMAKE_BUILD_TYPE=MinSizeRel -DBUILD_VERSION=$(NBGV_VersionMajor).$(NBGV_VersionMinor).$(NBGV_BuildNumber).$(TARGET_BUILD_COUNTER) -DTARGET_NAME=$(TargetPublishName) -DTOOL_SRECORD_PREFIX=$(SRECORD_PATH)/srecord/ $(BuildOptions) " workingDirectory: ${{ parameters.repoDirectory }} - task: CMake@1 displayName: Setup CMake build (DFU and SRecord) condition: and(eq(variables['NeedsDFU'], true), eq(variables['NeedsSRECORD'], true)) inputs: - cmakeArgs: "--preset $(CMakePreset) -DCMAKE_BUILD_TYPE=MinSizeRel -DBUILD_VERSION=$(NBGV_VersionMajor).$(NBGV_VersionMinor).$(NBGV_BuildNumber).$(TARGET_BUILD_COUNTER) -DTARGET_NAME=$(TargetPublishName) -DTOOL_HEX2DFU_PREFIX=$(HEX2DFU_PATH) -DTOOL_SRECORD_PREFIX=$(SRECORD_PATH)/srecord/ $(BuildOptions) " + cmakeArgs: "--preset $(CMakePreset) -DCMAKE_C_COMPILER_LAUNCHER=ccache -DCMAKE_CXX_COMPILER_LAUNCHER=ccache -DCMAKE_BUILD_TYPE=MinSizeRel -DBUILD_VERSION=$(NBGV_VersionMajor).$(NBGV_VersionMinor).$(NBGV_BuildNumber).$(TARGET_BUILD_COUNTER) -DTARGET_NAME=$(TargetPublishName) -DTOOL_HEX2DFU_PREFIX=$(HEX2DFU_PATH) -DTOOL_SRECORD_PREFIX=$(SRECORD_PATH)/srecord/ $(BuildOptions) " workingDirectory: ${{ parameters.repoDirectory }} - task: CMake@1 displayName: Setup CMake build (no DFU, no SRecord) condition: and(eq(variables['NeedsDFU'], false), eq(variables['NeedsSRECORD'], false)) inputs: - cmakeArgs: "--preset $(CMakePreset) -DCMAKE_BUILD_TYPE=MinSizeRel -DBUILD_VERSION=$(NBGV_VersionMajor).$(NBGV_VersionMinor).$(NBGV_BuildNumber).$(TARGET_BUILD_COUNTER) -DTARGET_NAME=$(TargetPublishName) $(BuildOptions) " + cmakeArgs: "--preset $(CMakePreset) -DCMAKE_C_COMPILER_LAUNCHER=ccache -DCMAKE_CXX_COMPILER_LAUNCHER=ccache -DCMAKE_BUILD_TYPE=MinSizeRel -DBUILD_VERSION=$(NBGV_VersionMajor).$(NBGV_VersionMinor).$(NBGV_BuildNumber).$(TARGET_BUILD_COUNTER) -DTARGET_NAME=$(TargetPublishName) $(BuildOptions) " workingDirectory: ${{ parameters.repoDirectory }} - task: CMake@1 @@ -44,3 +51,9 @@ steps: inputs: cmakeArgs: "--build --preset $(CMakePreset) --target all --config MinSizeRel" workingDirectory: ${{ parameters.repoDirectory }} + + - task: Cache@2 + displayName: Save ccache files + inputs: + key: 'ccache-chibios | 0' + path: $(Build.SourcesDirectory)/nf-interpreter/.ccache diff --git a/azure-pipelines-templates/build-espressif-esp32-targets.yml b/azure-pipelines-templates/build-espressif-esp32-targets.yml index 7ae9c3be61..8ab2278fc1 100644 --- a/azure-pipelines-templates/build-espressif-esp32-targets.yml +++ b/azure-pipelines-templates/build-espressif-esp32-targets.yml @@ -14,11 +14,25 @@ steps: parameters: repoDirectory: ${{ parameters.repoDirectory }} + - task: Cache@2 + displayName: Cache IDF components + inputs: + key: 'esp-idf-components-cache | 0' + path: $(Agent.BuildDirectory)/s/esp-idf/components + cacheHitVar: ESP32_COMPONENTS_RESTORED + + - task: Cache@2 + displayName: Cache ccache files + inputs: + key: 'ccache-$(IDF_Target) | 0' + path: $(Build.SourcesDirectory)/nf-interpreter/.ccache + cacheHitVar: CCACHE_RESTORED + - task: CMake@1 condition: succeeded() displayName: Setup build with CMake inputs: - cmakeArgs: "--preset $(CMakePreset) -DESP32_IDF_PATH=$(IDF_PATH) -DCMAKE_BUILD_TYPE=MinSizeRel -DBUILD_VERSION=$(NBGV_VersionMajor).$(NBGV_VersionMinor).$(NBGV_BuildNumber).$(TARGET_BUILD_COUNTER) -DTARGET_NAME=$(TargetPublishName) $(BuildOptions)" + cmakeArgs: "--preset $(CMakePreset) -DCCACHE_ENABLE=ON -DCMAKE_C_COMPILER_LAUNCHER=ccache -DCMAKE_CXX_COMPILER_LAUNCHER=ccache -DESP32_IDF_PATH=$(IDF_PATH) -DCMAKE_BUILD_TYPE=MinSizeRel -DBUILD_VERSION=$(NBGV_VersionMajor).$(NBGV_VersionMinor).$(NBGV_BuildNumber).$(TARGET_BUILD_COUNTER) -DTARGET_NAME=$(TargetPublishName) $(BuildOptions)" workingDirectory: ${{ parameters.repoDirectory }} - task: CMake@1 @@ -97,3 +111,15 @@ steps: TargetFolder: ${{ parameters.repoDirectory }}\build flattenFolders: false ignoreMakeDirErrors: true + + - task: Cache@2 + displayName: Save IDF components + inputs: + key: 'esp-idf-components-cache | 0' + path: $(Agent.BuildDirectory)/s/esp-idf/components + + - task: Cache@2 + displayName: Save ccache files + inputs: + key: 'ccache-$(IDF_Target) | 0' + path: $(Build.SourcesDirectory)/nf-interpreter/.ccache diff --git a/azure-pipelines-templates/build-freertos-nxp-targets.yml b/azure-pipelines-templates/build-freertos-nxp-targets.yml index 25c20196d7..789559b6b8 100644 --- a/azure-pipelines-templates/build-freertos-nxp-targets.yml +++ b/azure-pipelines-templates/build-freertos-nxp-targets.yml @@ -11,9 +11,16 @@ steps: parameters: repoDirectory: ${{ parameters.repoDirectory }} + - task: Cache@2 + displayName: Cache ccache files + inputs: + key: 'ccache-freeRTOS | 0' + path: $(Build.SourcesDirectory)/nf-interpreter/.ccache + cacheHitVar: CCACHE_RESTORED + - task: CMake@1 inputs: - cmakeArgs: "--preset $(CMakePreset) -DCMAKE_BUILD_TYPE=MinSizeRel -DBUILD_VERSION=$(NBGV_VersionMajor).$(NBGV_VersionMinor).$(NBGV_BuildNumber).$(TARGET_BUILD_COUNTER) -DTARGET_NAME=$(TargetPublishName) -DTOOL_SRECORD_PREFIX=$(SRECORD_PATH)/srecord/ $(BuildOptions)" + cmakeArgs: "--preset $(CMakePreset) -DCMAKE_C_COMPILER_LAUNCHER=ccache -DCMAKE_CXX_COMPILER_LAUNCHER=ccache -DCMAKE_BUILD_TYPE=MinSizeRel -DBUILD_VERSION=$(NBGV_VersionMajor).$(NBGV_VersionMinor).$(NBGV_BuildNumber).$(TARGET_BUILD_COUNTER) -DTARGET_NAME=$(TargetPublishName) -DTOOL_SRECORD_PREFIX=$(SRECORD_PATH)/srecord/ $(BuildOptions)" workingDirectory: ${{ parameters.repoDirectory }} displayName: Setup build with CMake @@ -22,3 +29,9 @@ steps: cmakeArgs: "--build --preset $(CMakePreset) --target all --config MinSizeRel" workingDirectory: ${{ parameters.repoDirectory }} displayName: Build with CMake + + - task: Cache@2 + displayName: Save ccache files + inputs: + key: 'ccache-freeRTOS | 0' + path: $(Build.SourcesDirectory)/nf-interpreter/.ccache diff --git a/azure-pipelines-templates/build-ti-simplelink-targets.yml b/azure-pipelines-templates/build-ti-simplelink-targets.yml index ba5677613e..cf9f30cc0b 100644 --- a/azure-pipelines-templates/build-ti-simplelink-targets.yml +++ b/azure-pipelines-templates/build-ti-simplelink-targets.yml @@ -11,9 +11,16 @@ steps: parameters: repoDirectory: ${{ parameters.repoDirectory }} + - task: Cache@2 + displayName: Cache ccache files + inputs: + key: 'ccache-ti-simplelink | 0' + path: $(Build.SourcesDirectory)/nf-interpreter/.ccache + cacheHitVar: CCACHE_RESTORED + - task: CMake@1 inputs: - cmakeArgs: " --preset $(TargetBoard) -DCMAKE_BUILD_TYPE=MinSizeRel -DBUILD_VERSION=$(NBGV_VersionMajor).$(NBGV_VersionMinor).$(NBGV_BuildNumber).$(TARGET_BUILD_COUNTER) -DTARGET_BOARD=$(TargetBoard) -DTARGET_NAME=$(TargetPublishName) $(BuildOptions)" + cmakeArgs: " --preset $(TargetBoard) -DCMAKE_C_COMPILER_LAUNCHER=ccache -DCMAKE_CXX_COMPILER_LAUNCHER=ccache -DCMAKE_BUILD_TYPE=MinSizeRel -DBUILD_VERSION=$(NBGV_VersionMajor).$(NBGV_VersionMinor).$(NBGV_BuildNumber).$(TARGET_BUILD_COUNTER) -DTARGET_BOARD=$(TargetBoard) -DTARGET_NAME=$(TargetPublishName) $(BuildOptions)" workingDirectory: ${{ parameters.repoDirectory }} displayName: Setup build with CMake @@ -22,3 +29,9 @@ steps: cmakeArgs: "--build --preset $(TargetBoard) --target all --config MinSizeRel" workingDirectory: ${{ parameters.repoDirectory }} displayName: Build with CMake + + - task: Cache@2 + displayName: Save ccache files + inputs: + key: 'ccache-ti-simplelink | 0' + path: $(Build.SourcesDirectory)/nf-interpreter/.ccache diff --git a/azure-pipelines-templates/download-ccache.yml b/azure-pipelines-templates/download-ccache.yml new file mode 100644 index 0000000000..364d93b85b --- /dev/null +++ b/azure-pipelines-templates/download-ccache.yml @@ -0,0 +1,33 @@ +# Copyright (c) .NET Foundation and Contributors +# See LICENSE file in the project root for full license information. + +steps: + - task: Cache@2 + displayName: "Cache ccache" + inputs: + key: "ccache | 4_10_2" + path: 'C:\Program Files\ccache' + cacheHitVar: CCACHE_CACHE_RESTORED + + - task: PowerShell@2 + displayName: Downloading Ccache + condition: ne(variables.CCACHE_CACHE_RESTORED, 'true') + inputs: + targetType: "inline" + script: | + $url = "https://github.com/ccache/ccache/releases/download/v4.10.2/ccache-4.10.2-windows-x86_64.zip" + $output = "$(Agent.TempDirectory)\ccache.zip" + (New-Object Net.WebClient).DownloadFile($url, $output) + errorActionPreference: "stop" + failOnStderr: true + + - task: ExtractFiles@1 + displayName: Install Ccache + condition: ne(variables.CCACHE_CACHE_RESTORED, 'true') + inputs: + archiveFilePatterns: '$(Agent.TempDirectory)\ccache.zip' + destinationFolder: '$(Agent.TempDirectory)\ccache' + + - script: echo "##vso[task.prependpath]$(Agent.TempDirectory)\ccache" + displayName: Add Ccache to PATH + condition: succeeded() diff --git a/azure-pipelines.yml b/azure-pipelines.yml index dd0d0be434..7d03c19cac 100644 --- a/azure-pipelines.yml +++ b/azure-pipelines.yml @@ -414,6 +414,7 @@ jobs: REVISION: $[counter('STM32_1_10_0_versioncounter', 0)] HelperPackageVersion: $[counter('HelperPackageVersioncounter', 0)] TargetPlatform: "stm32" + CCACHE_DIR: $(Build.SourcesDirectory)/nf-interpreter/.ccache steps: - template: azure-pipelines-templates/build-preparations.yml @@ -422,6 +423,7 @@ jobs: - template: azure-pipelines-templates/download-install-ninja.yml - template: azure-pipelines-templates/download-srecord.yml - template: azure-pipelines-templates/download-hexdfu.yml + - template: azure-pipelines-templates/download-ccache.yml - template: azure-pipelines-templates/build-chibios-stm32-targets.yml - template: azure-pipelines-templates/pack-publish-artifacts.yml - template: azure-pipelines-templates/publish-cloudsmith.yml @@ -563,6 +565,9 @@ jobs: # creates a counter and assigns it to the revision variable REVISION: $[counter('ESP32_1_10_0_versioncounter', 0)] IDF_PATH: "D:/a/1/s/esp-idf" + IDF_CCACHE_ENABLE: "1" + CCACHE_NOHASHDIR: "1" + CCACHE_DIR: $(Build.SourcesDirectory)/nf-interpreter/.ccache PIP_CACHE_DIR: $(Pipeline.Workspace)/.pip TargetPlatform: "esp32" @@ -645,6 +650,7 @@ jobs: REVISION: $[counter('NXP_1_10_0_versioncounter', 0)] GIT_LFS_SKIP_SMUDGE: 1 TargetPlatform: "freertos" + CCACHE_DIR: $(Build.SourcesDirectory)/nf-interpreter/.ccache steps: - template: azure-pipelines-templates/build-preparations.yml @@ -652,6 +658,7 @@ jobs: - template: azure-pipelines-templates/download-install-arm-gcc-toolchain.yml - template: azure-pipelines-templates/download-install-ninja.yml - template: azure-pipelines-templates/download-srecord.yml + - template: azure-pipelines-templates/download-ccache.yml - template: azure-pipelines-templates/build-freertos-nxp-targets.yml - template: azure-pipelines-templates/pack-publish-artifacts.yml - template: azure-pipelines-templates/publish-cloudsmith.yml @@ -723,12 +730,14 @@ jobs: REVISION: $[counter('TI_1_10_0_versioncounter', 0)] HelperPackageVersion: $[counter('HelperPackageVersioncounter', 0)] TargetPlatform: "ti_simplelink" + CCACHE_DIR: $(Build.SourcesDirectory)/nf-interpreter/.ccache steps: - template: azure-pipelines-templates/build-preparations.yml - template: azure-pipelines-templates/nb-gitversioning.yml - template: azure-pipelines-templates/download-install-arm-gcc-toolchain.yml - template: azure-pipelines-templates/download-install-ninja.yml + - template: azure-pipelines-templates/download-ccache.yml - template: azure-pipelines-templates/build-ti-simplelink-targets.yml - template: azure-pipelines-templates/pack-publish-artifacts.yml - template: azure-pipelines-templates/publish-cloudsmith.yml @@ -794,6 +803,7 @@ jobs: REVISION: $[counter('AZURERTOS_1_10_0_versioncounter', 0)] HelperPackageVersion: $[counter('HelperPackageVersioncounter', 0)] TargetPlatform: "azure_rtos" + CCACHE_DIR: $(Build.SourcesDirectory)/nf-interpreter/.ccache steps: - template: azure-pipelines-templates/build-preparations.yml @@ -802,6 +812,7 @@ jobs: - template: azure-pipelines-templates/download-install-ninja.yml - template: azure-pipelines-templates/download-hexdfu.yml - template: azure-pipelines-templates/download-srecord.yml + - template: azure-pipelines-templates/download-ccache.yml - template: azure-pipelines-templates/build-azurertos-targets.yml - template: azure-pipelines-templates/pack-publish-artifacts.yml - template: azure-pipelines-templates/publish-cloudsmith.yml diff --git a/targets/AzureRTOS/CMakeLists.txt b/targets/AzureRTOS/CMakeLists.txt index cbfca05874..3aa7181c78 100644 --- a/targets/AzureRTOS/CMakeLists.txt +++ b/targets/AzureRTOS/CMakeLists.txt @@ -109,7 +109,7 @@ else() endif() -FetchContent_Populate(azure_rtos) +FetchContent_MakeAvailable(azure_rtos) ########################### # Azure RTOS USBX @@ -168,7 +168,7 @@ if(AZURERTOS_USBX_REQUIRED) endif() - FetchContent_Populate(azure_rtos_usbx) + FetchContent_MakeAvailable(azure_rtos_usbx) endif() @@ -229,7 +229,7 @@ if(AZURERTOS_FILEX_REQUIRED) endif() - FetchContent_Populate(azure_rtos_filex) + FetchContent_MakeAvailable(azure_rtos_filex) endif() @@ -293,7 +293,7 @@ if(AZURERTOS_NETXDUO_REQUIRED) # enable BSD layer in NetX Duo set(NXD_ENABLE_BSD TRUE) - FetchContent_Populate(azure_rtos_netxduo) + FetchContent_MakeAvailable(azure_rtos_netxduo) endif() diff --git a/targets/AzureRTOS/Maxim/CMakeLists.txt b/targets/AzureRTOS/Maxim/CMakeLists.txt index 185070cab2..b8eff15b1a 100644 --- a/targets/AzureRTOS/Maxim/CMakeLists.txt +++ b/targets/AzureRTOS/Maxim/CMakeLists.txt @@ -62,7 +62,7 @@ else() endif() -FetchContent_Populate(maxim_micros_sdk) +FetchContent_MakeAvailable(maxim_micros_sdk) # make vars global set(NANOCLR_PROJECT_SOURCES ${NANOCLR_PROJECT_SOURCES} CACHE INTERNAL "make global") @@ -125,7 +125,7 @@ else() endif() FetchContent_GetProperties(cmsis) -FetchContent_Populate(cmsis) +FetchContent_MakeAvailable(cmsis) # add platform dirs add_subdirectory(_include) diff --git a/targets/AzureRTOS/MicroBit/CMakeLists.txt b/targets/AzureRTOS/MicroBit/CMakeLists.txt index 2183d7a578..3cef5bd643 100644 --- a/targets/AzureRTOS/MicroBit/CMakeLists.txt +++ b/targets/AzureRTOS/MicroBit/CMakeLists.txt @@ -60,7 +60,7 @@ else() endif() -FetchContent_Populate(CODALMicroBitV2) +FetchContent_MakeAvailable(CODALMicroBitV2) #################### # CODAL Core @@ -116,7 +116,7 @@ else() endif() -FetchContent_Populate(CodalCore) +FetchContent_MakeAvailable(CodalCore) #################### # CODAL NRF52 @@ -172,7 +172,7 @@ else() endif() -FetchContent_Populate(CodalNrf52) +FetchContent_MakeAvailable(CodalNrf52) ######################## # CODAL Micro Bit NRF52 SDK @@ -228,7 +228,7 @@ else() endif() -FetchContent_Populate(CodalMicrobitNrf5Sdk) +FetchContent_MakeAvailable(CodalMicrobitNrf5Sdk) # make vars global set(NANOCLR_PROJECT_SOURCES ${NANOCLR_PROJECT_SOURCES} CACHE INTERNAL "make global") diff --git a/targets/AzureRTOS/Nordic/CMakeLists.txt b/targets/AzureRTOS/Nordic/CMakeLists.txt index 0ff58ba341..e571ca3624 100644 --- a/targets/AzureRTOS/Nordic/CMakeLists.txt +++ b/targets/AzureRTOS/Nordic/CMakeLists.txt @@ -57,7 +57,7 @@ else() endif() -FetchContent_Populate(nRFConnectSdk) +FetchContent_MakeAvailable(nRFConnectSdk) # Point to NCS root directory set(NRF_DIR ${nRFConnectSdk_SOURCE_DIR} CACHE PATH "NCS root directory") diff --git a/targets/AzureRTOS/RaspberryPi/CMakeLists.txt b/targets/AzureRTOS/RaspberryPi/CMakeLists.txt index 58b60948af..2c10177349 100644 --- a/targets/AzureRTOS/RaspberryPi/CMakeLists.txt +++ b/targets/AzureRTOS/RaspberryPi/CMakeLists.txt @@ -60,7 +60,7 @@ else() endif() -FetchContent_Populate(pico_sdk) +FetchContent_MakeAvailable(pico_sdk) # set these to help Pico SDK set(PICO_TOOLCHAIN_PATH ${TOOLCHAIN_PREFIX}) diff --git a/targets/AzureRTOS/ST/CMakeLists.txt b/targets/AzureRTOS/ST/CMakeLists.txt index a0a49cfdcd..93be746a9d 100644 --- a/targets/AzureRTOS/ST/CMakeLists.txt +++ b/targets/AzureRTOS/ST/CMakeLists.txt @@ -81,7 +81,7 @@ else() endif() FetchContent_GetProperties(chibios) -FetchContent_Populate(chibios) +FetchContent_MakeAvailable(chibios) list(APPEND TARGET_AZURERTOS_COMMON_INCLUDE_DIRS ${CMAKE_CURRENT_SOURCE_DIR}/_include) diff --git a/targets/AzureRTOS/SiliconLabs/CMakeLists.txt b/targets/AzureRTOS/SiliconLabs/CMakeLists.txt index f5e29715ea..001850b444 100644 --- a/targets/AzureRTOS/SiliconLabs/CMakeLists.txt +++ b/targets/AzureRTOS/SiliconLabs/CMakeLists.txt @@ -114,7 +114,7 @@ else() endif() FetchContent_GetProperties(gecko_sdk) -FetchContent_Populate(gecko_sdk) +FetchContent_MakeAvailable(gecko_sdk) # including here the CMake files for the source files specific to the target series include(AzureRTOS_${TARGET_SERIES}_sources) diff --git a/targets/ChibiOS/CMakeLists.txt b/targets/ChibiOS/CMakeLists.txt index d9e49a3715..dff6aae770 100644 --- a/targets/ChibiOS/CMakeLists.txt +++ b/targets/ChibiOS/CMakeLists.txt @@ -106,7 +106,7 @@ endif() FetchContent_GetProperties(chibios) if(NOT chibios_POPULATED) # Fetch the content using previously declared details - FetchContent_Populate(chibios) + FetchContent_MakeAvailable(chibios) endif() if(CHIBIOS_CONTRIB_REQUIRED) @@ -137,7 +137,7 @@ if(CHIBIOS_CONTRIB_REQUIRED) FetchContent_GetProperties(chibios-contrib) if(NOT chibios-contrib_POPULATED) # Fetch the content using previously declared details - FetchContent_Populate(chibios-contrib) + FetchContent_MakeAvailable(chibios-contrib) endif() endif() @@ -199,7 +199,7 @@ if(NF_FEATURE_HAS_SDCARD OR NF_FEATURE_HAS_USB_MSD) FetchContent_GetProperties(fatfs) if(NOT fatfs_POPULATED) # Fetch the content using previously declared details - FetchContent_Populate(fatfs) + FetchContent_MakeAvailable(fatfs) endif() # have to delete the ffconf.h template from the repo @@ -373,7 +373,7 @@ if(NF_FEATURE_USE_LITTLEFS_OPTION) FetchContent_GetProperties(littlefs) if(NOT littlefs_POPULATED) # Fetch the content using previously declared details - FetchContent_Populate(littlefs) + FetchContent_MakeAvailable(littlefs) endif() endif() diff --git a/targets/ESP32/CMakeLists.txt b/targets/ESP32/CMakeLists.txt index e047b8292a..1e12e1da56 100644 --- a/targets/ESP32/CMakeLists.txt +++ b/targets/ESP32/CMakeLists.txt @@ -88,7 +88,7 @@ endif() FetchContent_GetProperties(esp32_idf) if(NOT esp32_idf_POPULATED) # Fetch the content using previously declared details - FetchContent_Populate(esp32_idf) + FetchContent_MakeAvailable(esp32_idf) endif() # add IDF CMake dir to modules path diff --git a/targets/FreeRTOS/CMakeLists.txt b/targets/FreeRTOS/CMakeLists.txt index a82e68ad0f..6d97146771 100644 --- a/targets/FreeRTOS/CMakeLists.txt +++ b/targets/FreeRTOS/CMakeLists.txt @@ -75,7 +75,7 @@ endif() FetchContent_GetProperties(freertos) if(NOT freertos_POPULATED) # Fetch the content using previously declared details - FetchContent_Populate(freertos) + FetchContent_MakeAvailable(freertos) endif() # check if CMSIS_SOURCE was specified or if it's empty (default is empty) @@ -129,10 +129,10 @@ else() endif() FetchContent_GetProperties(cmsis) -FetchContent_Populate(cmsis) +FetchContent_MakeAvailable(cmsis) if(NOT cmsis_POPULATED) # Fetch the content using previously declared details - FetchContent_Populate(cmsis) + FetchContent_MakeAvailable(cmsis) endif() # FreeRTOS common directories diff --git a/targets/FreeRTOS/NXP/CMakeLists.txt b/targets/FreeRTOS/NXP/CMakeLists.txt index 6cbe02181e..3ece9c0928 100644 --- a/targets/FreeRTOS/NXP/CMakeLists.txt +++ b/targets/FreeRTOS/NXP/CMakeLists.txt @@ -58,7 +58,7 @@ endif() FetchContent_GetProperties(fatfs) if(NOT fatfs_POPULATED) # Fetch the content using previously declared details - FetchContent_Populate(fatfs) + FetchContent_MakeAvailable(fatfs) endif() # have to delete the ffconf.h template from the repo diff --git a/targets/TI_SimpleLink/CMakeLists.txt b/targets/TI_SimpleLink/CMakeLists.txt index 51ad74fa24..af8a302396 100644 --- a/targets/TI_SimpleLink/CMakeLists.txt +++ b/targets/TI_SimpleLink/CMakeLists.txt @@ -58,7 +58,7 @@ if("${TARGET_SERIES}" STREQUAL "CC32xx") FetchContent_GetProperties(simplelinkcc32xxsdk) if(NOT simplelinkcc32xxsdk_POPULATED) # Fetch the content using previously declared details - FetchContent_Populate(simplelinkcc32xxsdk) + FetchContent_MakeAvailable(simplelinkcc32xxsdk) endif() # check if TI_XDCTOOLS_SOURCE was specified or if it's empty (default is empty) @@ -108,7 +108,7 @@ if("${TARGET_SERIES}" STREQUAL "CC32xx") FetchContent_GetProperties(ti_xdctools) if(NOT ti_xdctools_POPULATED) # Fetch the content using previously declared details - FetchContent_Populate(ti_xdctools) + FetchContent_MakeAvailable(ti_xdctools) endif() set(TI_XDCTools_INCLUDE_DIR ${ti_xdctools_SOURCE_DIR}/packages/ PARENT_SCOPE) @@ -159,7 +159,7 @@ elseif( "${TARGET_SERIES}" STREQUAL "CC13X2" ) FetchContent_GetProperties(simplelinkcc13xx_26xxsdk) if(NOT simplelinkcc13xx_26xxsdk_POPULATED) # Fetch the content using previously declared details - FetchContent_Populate(simplelinkcc13xx_26xxsdk) + FetchContent_MakeAvailable(simplelinkcc13xx_26xxsdk) endif() # check if TI_SYSCONFIG_SOURCE was specified or if it's empty (default is empty) @@ -209,7 +209,7 @@ elseif( "${TARGET_SERIES}" STREQUAL "CC13X2" ) FetchContent_GetProperties(ti_sysconfig) if(NOT ti_sysconfig_POPULATED) # Fetch the content using previously declared details - FetchContent_Populate(ti_sysconfig) + FetchContent_MakeAvailable(ti_sysconfig) endif() # check if TI_XDCTOOLS_SOURCE was specified or if it's empty (default is empty) @@ -259,7 +259,7 @@ elseif( "${TARGET_SERIES}" STREQUAL "CC13X2" ) FetchContent_GetProperties(ti_xdctools) if(NOT ti_xdctools_POPULATED) # Fetch the content using previously declared details - FetchContent_Populate(ti_xdctools) + FetchContent_MakeAvailable(ti_xdctools) endif() set(TI_XDCTools_INCLUDE_DIR ${ti_xdctools_SOURCE_DIR}/packages/ PARENT_SCOPE)