-# Copyright (c) 2011 Samsung Electronics Co., Ltd All Rights Reserved
+# Copyright (c) 2011 - 2018 Samsung Electronics Co., Ltd All Rights Reserved
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
SET(CMAKE_C_FLAGS_CCOV "-g -O2 --coverage")
SET(CMAKE_CXX_FLAGS_CCOV "-g -std=c++0x -O2 --coverage")
-# If supported for the target machine, emit position-independent code,suitable
-# for dynamic linking and avoiding any limit on the size of the global offset
-# table. This option makes a difference on the m68k, PowerPC and SPARC.
-# (BJ: our ARM too?)
-ADD_DEFINITIONS("-fPIC")
+# Force PIE
+SET(CMAKE_POSITION_INDEPENDENT_CODE "True")
+SET(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -pie")
# Set compiler warning flags
ADD_DEFINITIONS("-Werror") # Make all warnings into errors.
ADD_DEFINITIONS("-DRO_DATA_DIR=\"${RO_DATA_DIR}\"")
ADD_DEFINITIONS("-DETC_DIR=\"${ETC_DIR}\"")
ADD_DEFINITIONS("-DBIN_DIR=\"${BIN_DIR}\"")
-ADD_DEFINITIONS("-DINITIAL_VALUES_DIR=\"${INITIAL_VALUES_DIR}\"")
+ADD_DEFINITIONS("-DINITIAL_VALUES_DIR_RO=\"${INITIAL_VALUES_DIR_RO}\"")
+ADD_DEFINITIONS("-DINITIAL_VALUES_DIR_RW=\"${INITIAL_VALUES_DIR_RW}\"")
ADD_DEFINITIONS("-DCA_CERTS_DIR=\"${CA_CERTS_DIR}\"")
ADD_DEFINITIONS("-DSYSTEMD_ENV_FILE=\"${SYSTEMD_ENV_FILE}\"")
+IF (TZ_BACKEND_ENABLED)
+ ADD_DEFINITIONS("-DTZ_BACKEND_ENABLED")
+ENDIF()
+
+IF (DEFINED WATCHDOG_ENABLED)
+ MESSAGE("WATCHDOG ENABELD!")
+ ADD_DEFINITIONS("-DWATCHDOG_ENABLED")
+ ADD_DEFINITIONS("-DWATCHDOG_TIMEOUT_SEC=${WATCHDOG_TIMEOUT_SEC}")
+ ADD_DEFINITIONS("-DWATCHDOG_NOTIFY_SEC=${WATCHDOG_NOTIFY_SEC}")
+ SET(WATCHDOG_DECLARE "NotifyAccess=main")
+ENDIF (DEFINED WATCHDOG_ENABLED)
+
IF (CMAKE_BUILD_TYPE MATCHES "DEBUG")
ADD_DEFINITIONS("-DTIZEN_DEBUG_ENABLE")
ADD_DEFINITIONS("-DBUILD_TYPE_DEBUG")