blob: 02826430453ddfd67106735d6e4aa61f528da4c0 [file] [log] [blame]
Vinay Kumar Kotegowder9982f902019-07-15 09:13:54 +05301#/** @file
jk-arm957cfea2021-06-18 15:52:12 +05302# * Copyright (c) 2019-2021, Arm Limited or its affiliates. All rights reserved.
Vinay Kumar Kotegowder9982f902019-07-15 09:13:54 +05303# * SPDX-License-Identifier : Apache-2.0
4# *
5# * Licensed under the Apache License, Version 2.0 (the "License");
6# * you may not use this file except in compliance with the License.
7# * You may obtain a copy of the License at
8# *
9# * http://www.apache.org/licenses/LICENSE-2.0
10# *
11# * Unless required by applicable law or agreed to in writing, software
12# * distributed under the License is distributed on an "AS IS" BASIS,
13# * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14# * See the License for the specific language governing permissions and
15# * limitations under the License.
16#**/
17
18set(CMAKE_SYSTEM_NAME Generic)
19set(CMKE_SYSTEM_PROCESSOR x86_64)
20
21set(_C_TOOLCHAIN_NAME gcc)
22
23if(WIN32)
24 if (NOT DEFINED HOST_GCC_PATH)
25 set(HOST_GCC_PATH "C:" CACHE PATH "Install directory for Host GCC Compiler")
26 endif()
27else(WIN32)
28 if (NOT DEFINED HOST_GCC_PATH)
29 set(HOST_GCC_PATH "/" CACHE PATH "Install directory for Host GCC Compiler")
30 endif()
31endif(WIN32)
32
33find_program(
34 _C_TOOLCHAIN_PATH
35 ${_C_TOOLCHAIN_NAME}
36 PATHS env PATH
37 HINTS ${HOST_GCC_PATH}
38 HINTS bin
39)
40
41if(_C_TOOLCHAIN_PATH STREQUAL "_C_TOOLCHAIN_PATH-NOTFOUND")
42 message(FATAL_ERROR "[PSA] : Couldn't find ${_C_TOOLCHAIN_NAME}."
43 " Either put ${_C_TOOLCHAIN_NAME} on the PATH or set GNUARM_PATH set properly.")
44endif()
45
46set(CMAKE_TRY_COMPILE_TARGET_TYPE STATIC_LIBRARY)
47
48foreach(_LNG IN ITEMS "C" "ASM")
49 set(CMAKE_${_LNG}_COMPILER ${_C_TOOLCHAIN_PATH})
jotman016d7dd4e2020-11-10 17:32:28 +080050 set(CMAKE_C_FLAGS "-g -Wall -Werror -Werror -std=c99")
Vinay Kumar Kotegowder9982f902019-07-15 09:13:54 +053051 message(STATUS "[PSA] : ${_LNG} compiler used '${CMAKE_${_LNG}_COMPILER}'")
52endforeach()
jk-arm01ee3ff2021-10-18 22:41:47 +053053add_definitions(-DMISSING_CRYPTO_1_0=1)