aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRaef Coles <raef.coles@arm.com>2020-09-25 10:36:16 +0100
committerRaef Coles <raef.coles@arm.com>2020-09-25 10:36:16 +0100
commit5e8ea8413ea82e2fd5e0b26ef48190753b6f4e63 (patch)
tree9b377eb9cb9f801a2fb01f41fa23a15c666f1c4b
parent18b3bf07dca20864110cbd7987209d9338ff912a (diff)
downloadtrusted-firmware-m-5e8ea8413ea82e2fd5e0b26ef48190753b6f4e63.tar.gz
Build: Fix minor issues with new buildsystem
Several minor bugfixes: * Add error messages for unsupported generators / compilers * Remove unsupported warning disablement option on IAR * Fix typo in error message Change-Id: I492872d5af5e507d52e2f9f1fbb28f39359349ee Signed-off-by: Raef Coles <raef.coles@arm.com>
-rw-r--r--CMakeLists.txt15
-rw-r--r--bl2/CMakeLists.txt2
-rw-r--r--secure_fw/CMakeLists.txt3
-rw-r--r--secure_fw/partitions/crypto/CMakeLists.txt3
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