# # upgrade-engine # # Copyright (c) 2021 Samsung Electronics Co., Ltd. # # 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. # CMAKE_MINIMUM_REQUIRED(VERSION 2.82) PROJECT(upgrade C) INCLUDE_DIRECTORIES(${CMAKE_CURRENT_SOURCE_DIR}/src/) IF("${CMAKE_BUILD_TYPE}" STREQUAL "") SET(CMAKE_BUILD_TYPE "Release") ENDIF("${CMAKE_BUILD_TYPE}" STREQUAL "") MESSAGE("Build type: ${CMAKE_BUILD_TYPE}") SET(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${EXTRA_CFLAGS} -fPIC -fPIE") SET(CMAKE_C_FLAGS_DEBUG "-O0 -g") SET(CMAKE_C_FLAGS_RELEASE "-O2") FIND_PROGRAM(UNAME NAMES uname) IF("${ARCH}" STREQUAL "arm") ADD_DEFINITIONS("-DTARGET") MESSAGE("add -DTARGET") ENDIF("${ARCH}" STREQUAL "arm") ADD_DEFINITIONS("-DPREFIX=\"${PREFIX}\"") SET(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -Wl,--as-needed -pie") ADD_SUBDIRECTORY(src/dmverity) ADD_SUBDIRECTORY(src/img-verifier) ADD_SUBDIRECTORY(src/upgrade-apply) ADD_SUBDIRECTORY(src/blkid-print) ADD_SUBDIRECTORY(data) ADD_SUBDIRECTORY(scripts/rw-upgrade)