diff options
-rw-r--r-- | CMakeLists.txt | 15 | ||||
-rw-r--r-- | bl2/CMakeLists.txt | 2 | ||||
-rw-r--r-- | secure_fw/CMakeLists.txt | 3 | ||||
-rw-r--r-- | secure_fw/partitions/crypto/CMakeLists.txt | 3 |
4 files changed, 20 insertions, 3 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt index 68730c0a4c..87fbe0660b 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -20,6 +20,21 @@ if (NOT CMAKE_BUILD_TYPE) set(CMAKE_BUILD_TYPE "Release" CACHE STRING "Build type: [Debug, Release, RelWithDebInfo, MinSizeRel]" FORCE) endif() +if( + NOT ${CMAKE_C_COMPILER_ID} STREQUAL "GNU" AND + NOT ${CMAKE_C_COMPILER_ID} STREQUAL "ARMclang" AND + NOT ${CMAKE_C_COMPILER_ID} STREQUAL "IAR" +) + Message(FATAL_ERROR "unsupported c compiler ${CMAKE_C_COMPILER_ID}") +endif() + +if( + NOT ${CMAKE_GENERATOR} STREQUAL "Unix Makefiles" AND + NOT ${CMAKE_GENERATOR} STREQUAL "Ninja" +) + Message(FATAL_ERROR "unsupported generator ${CMAKE_GENERATOR}. Hint: Try -G\"Unix Makefiles\"") +endif() + ############################ CONFIGURATION ##################################### # First load defaults. diff --git a/bl2/CMakeLists.txt b/bl2/CMakeLists.txt index c839c9aec3..f206e90d74 100644 --- a/bl2/CMakeLists.txt +++ b/bl2/CMakeLists.txt @@ -94,7 +94,7 @@ add_subdirectory(${MBEDCRYPTO_PATH} ${CMAKE_CURRENT_BINARY_DIR}/mbedcrypto) set(CMAKE_BUILD_TYPE ${SAVED_BUILD_TYPE} CACHE STRING "Build type: [Debug, Release, RelWithDebInfo, MinSizeRel]" FORCE) if(NOT TARGET mbedcrypto_bl2) - message(FATAL_ERROR "Target mbedcrypto_crypto_service does not exist. Have the patches in ${CMAKE_SOURCE_DIR}/lib/ext/mbedcrypto been applied to the mbedcrypto repo at ${MBEDCRYPTO_PATH} ? + message(FATAL_ERROR "Target mbedcrypto_bl2 does not exist. Have the patches in ${CMAKE_SOURCE_DIR}/lib/ext/mbedcrypto been applied to the mbedcrypto repo at ${MBEDCRYPTO_PATH} ? Hint: The command might be `cd ${MBEDCRYPTO_PATH} && git apply ${CMAKE_SOURCE_DIR}/lib/ext/mbedcrypto/*.patch`") endif() diff --git a/secure_fw/CMakeLists.txt b/secure_fw/CMakeLists.txt index cc5eb1e02d..e109e3dc8f 100644 --- a/secure_fw/CMakeLists.txt +++ b/secure_fw/CMakeLists.txt @@ -81,7 +81,8 @@ set_source_files_properties( ${CMAKE_SOURCE_DIR}/interface/src/psa/psa_client.c ${CMAKE_SOURCE_DIR}/interface/src/psa/psa_service.c PROPERTIES - COMPILE_FLAGS -Wno-unused-parameter + COMPILE_FLAGS $<$<C_COMPILER_ID:GNU>:-Wno-unused-parameter> + COMPILE_FLAGS $<$<C_COMPILER_ID:ARMClang>:-Wno-unused-parameter> ) ############################# Secure veneers ################################### diff --git a/secure_fw/partitions/crypto/CMakeLists.txt b/secure_fw/partitions/crypto/CMakeLists.txt index e10de61c64..003d902624 100644 --- a/secure_fw/partitions/crypto/CMakeLists.txt +++ b/secure_fw/partitions/crypto/CMakeLists.txt @@ -143,7 +143,8 @@ target_sources(mbedcrypto_crypto_service target_compile_options(mbedcrypto_crypto_service PRIVATE - -Wno-unused-parameter + $<$<C_COMPILER_ID:GNU>:-Wno-unused-parameter> + $<$<C_COMPILER_ID:ARMClang>:-Wno-unused-parameter> ) target_link_libraries(mbedcrypto_crypto_service |