Przeglądaj źródła

CMSIS testing.

Add ability to fetch ST's sources for tests.
Konstantin Oblaukhov 5 lat temu
rodzic
commit
1d35cef237

+ 14 - 1
.github/workflows/cmake.yml

@@ -24,7 +24,20 @@ jobs:
       working-directory: ${{runner.workspace}}/tests/fetch/build
       run: cmake $GITHUB_WORKSPACE/tests/fetch/
 
-    - name: Build
+    - name: Build tests/fetch
       working-directory: ${{runner.workspace}}/tests/fetch/build
       shell: bash
       run: cmake --build . --config $BUILD_TYPE
+
+    - name: Create build directory for tests/cmsis
+      run: cmake -E make_directory ${{runner.workspace}}/tests/cmsis/build
+
+    - name: Configure tests/cmsis
+      shell: bash
+      working-directory: ${{runner.workspace}}/tests/cmsis/build
+      run: cmake -DFETCH_ST_SOURCES=TRUE $GITHUB_WORKSPACE/tests/cmsis/
+
+    - name: Build tests/cmsis
+      working-directory: ${{runner.workspace}}/tests/cmsis/build
+      shell: bash
+      run: cmake --build . --config $BUILD_TYPE

+ 4 - 0
tests/cmsis/CMakeLists.txt

@@ -7,6 +7,10 @@ endif()
 
 project(cmsis-test C ASM)
 
+if(FETCH_ST_SOURCES)
+    stm32_fetch_cmsis(${TEST_FAMILIES})
+endif()
+
 find_package(CMSIS REQUIRED)
 
 set(SOURCES main.c)

+ 5 - 0
tests/hal/CMakeLists.txt

@@ -8,6 +8,11 @@ endif()
 project(hal-test C ASM)
 set(CMAKE_INCLUDE_CURRENT_DIR TRUE)
 
+if(FETCH_ST_SOURCES)
+    stm32_fetch_cmsis(${TEST_FAMILIES})
+    stm32_fetch_hal(${TEST_FAMILIES})
+endif()
+
 find_package(CMSIS REQUIRED)
 find_package(HAL REQUIRED)