Skip to content

Commit

Permalink
[OIS] Update Open IoT SDK version
Browse files Browse the repository at this point in the history
Update OIS version to the latest.
Update TF-M platform and settings.
Update MDH components file naming and targets.
Update toolchain library version.
Create build-type profiles to set proper compiler and linker flags.
Fix inet test issue - skip TestInetLayer test.

Signed-off-by: ATmobica <artur.tynecki@arm.com>
  • Loading branch information
ATmobica committed Jul 11, 2023
1 parent b91328e commit ec0200f
Show file tree
Hide file tree
Showing 15 changed files with 363 additions and 84 deletions.
4 changes: 2 additions & 2 deletions config/openiotsdk/cmake/linker.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -21,10 +21,10 @@

function(set_target_link target)
target_link_libraries(${target}
mdh-arm-corstone-300-startup
mdh-arm-startup-an552
)

if (NOT LINKER_SCRIPT)
if (NOT LINKER_SCRIPT)
set(LINKER_SCRIPT ${OPEN_IOT_SDK_CONFIG}/ld/cs300_gcc.ld)
endif()
target_link_options(${target} PRIVATE -T ${LINKER_SCRIPT})
Expand Down
43 changes: 43 additions & 0 deletions config/openiotsdk/cmake/profile.cmake
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
#
# Copyright (c) 2023 Project CHIP Authors
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
#

#
# @file
# CMake profile configuration for target
#

# Set the default build type if none is specified
if(NOT CMAKE_BUILD_TYPE)
set(CMAKE_BUILD_TYPE "Release" CACHE
STRING "The build type" FORCE
)
endif()

set(SUPPORTED_BUILD_TYPES Debug Release)

# Force the build types to be case-insensitive for checking
set(LOWERCASE_SUPPORTED_BUILD_TYPES ${SUPPORTED_BUILD_TYPES})
list(TRANSFORM LOWERCASE_SUPPORTED_BUILD_TYPES TOLOWER)
string(TOLOWER ${CMAKE_BUILD_TYPE} LOWERCASE_CMAKE_BUILD_TYPE)

if(NOT LOWERCASE_CMAKE_BUILD_TYPE IN_LIST LOWERCASE_SUPPORTED_BUILD_TYPES)
message(FATAL_ERROR "Invalid build type '${CMAKE_BUILD_TYPE}'. Possible values:\n ${SUPPORTED_BUILD_TYPES}")
endif()

include(profiles/${LOWERCASE_CMAKE_BUILD_TYPE})

add_library(project_profile INTERFACE)
set_profile_options(project_profile)
65 changes: 65 additions & 0 deletions config/openiotsdk/cmake/profiles/debug.cmake
Original file line number Diff line number Diff line change
@@ -0,0 +1,65 @@
# Copyright (c) 2020-2021 Arm Limited
# SPDX-License-Identifier: Apache-2.0
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

# Sets profile options
function(set_profile_options target)
set(profile_link_options "")

if(${CMAKE_C_COMPILER_ID} STREQUAL GNU)
list(APPEND profile_c_compile_options
"-c"
"-Og"
"-g3"
)
target_compile_options(${target}
INTERFACE
$<$<COMPILE_LANGUAGE:C>:${profile_c_compile_options}>
)

list(APPEND profile_cxx_compile_options
"-c"
"-fno-rtti"
"-Wvla"
"-Og"
"-g3"
)
target_compile_options(${target}
INTERFACE
$<$<COMPILE_LANGUAGE:CXX>:${profile_cxx_compile_options}>
)

list(APPEND profile_asm_compile_options
"-c"
"-x" "assembler-with-cpp"
)
target_compile_options(${target}
INTERFACE
$<$<COMPILE_LANGUAGE:ASM>:${profile_asm_compile_options}>
)

list(APPEND profile_link_options
"-Wl,--gc-sections"
"-Wl,-n"
)

target_link_options(${target}
INTERFACE
"-Wl,--gc-sections"
"-Wl,-n"
)
else()
message(FATAL_ERROR "Invalid compiler type '${CMAKE_C_COMPILER_ID}'. Possible values:\n GNU")
endif()
endfunction()
70 changes: 70 additions & 0 deletions config/openiotsdk/cmake/profiles/release.cmake
Original file line number Diff line number Diff line change
@@ -0,0 +1,70 @@
# Copyright (c) 2020-2021 Arm Limited
# SPDX-License-Identifier: Apache-2.0
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

# Sets profile options
function(set_profile_options target)
set(profile_link_options "")

if(${CMAKE_C_COMPILER_ID} STREQUAL GNU)
list(APPEND profile_c_compile_options
"-c"
"-O2"
"-g3"
)
target_compile_options(${target}
INTERFACE
$<$<COMPILE_LANGUAGE:C>:${profile_c_compile_options}>
)

list(APPEND profile_cxx_compile_options
"-c"
"-fno-rtti"
"-Wvla"
"-O2"
"-g3"
)
target_compile_options(${target}
INTERFACE
$<$<COMPILE_LANGUAGE:CXX>:${profile_cxx_compile_options}>
)

list(APPEND profile_asm_compile_options
"-c"
"-x" "assembler-with-cpp"
)
target_compile_options(${target}
INTERFACE
$<$<COMPILE_LANGUAGE:ASM>:${profile_asm_compile_options}>
)

list(APPEND profile_link_options
"-Wl,--gc-sections"
"-Wl,-n"
)

target_link_options(${target}
INTERFACE
"-Wl,--gc-sections"
"-Wl,-n"
)
else()
message(FATAL_ERROR "Invalid compiler type '${CMAKE_C_COMPILER_ID}'. Possible values:\n GNU")
endif()

target_compile_definitions(${target}
INTERFACE
NDEBUG
)
endfunction()
Loading

0 comments on commit ec0200f

Please sign in to comment.