From: Karol Lewandowski Date: Tue, 26 Mar 2019 14:00:42 +0000 (+0100) Subject: Introduce defs.h with all cmake variables X-Git-Tag: submit/tizen/20190425.131325~4 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=3bc844a5ae5b8f9cf0def0202d1dc298bc0b4976;p=platform%2Fcore%2Fsystem%2Fcrash-worker.git Introduce defs.h with all cmake variables Change-Id: Ic3fb4f3d6074b896f7601d07a7a93cb96f9e8727 --- diff --git a/CMakeLists.txt b/CMakeLists.txt index 8003dae..49a9356 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -6,6 +6,9 @@ SET(PREFIX ${CMAKE_INSTALL_PREFIX}) ADD_DEFINITIONS(-D_FILE_OFFSET_BITS=64 -D_GNU_SOURCE=1) # Sub modules +ADD_SUBDIRECTORY(include) +INCLUDE_DIRECTORIES(${CMAKE_SOURCE_DIR}/include) + ADD_SUBDIRECTORY(src/crash-manager) IF("${SYS_ASSERT}" STREQUAL "ON") diff --git a/include/CMakeLists.txt b/include/CMakeLists.txt new file mode 100644 index 0000000..ce9314c --- /dev/null +++ b/include/CMakeLists.txt @@ -0,0 +1,4 @@ +CMAKE_MINIMUM_REQUIRED(VERSION 2.6) +PROJECT(crash-manager C) + +CONFIGURE_FILE(defs.h.in defs.h @ONLY) diff --git a/include/defs.h.in b/include/defs.h.in new file mode 100644 index 0000000..25e465e --- /dev/null +++ b/include/defs.h.in @@ -0,0 +1,14 @@ +#ifndef __DEFS_H__ +#define __DEFS_H__ + +#define CRASH_PATH "@CRASH_PATH@" +#define CRASH_ROOT_PATH "@CRASH_ROOT_PATH@" +#define CRASH_TEMP "@CRASH_TEMP@" +#define SYS_ASSERT "@SYS_ASSERT@" +#define CRASH_STACK_PATH "@CRASH_STACK_PATH@" +#define CRASH_MANAGER_CONFIG_PATH "@CRASH_MANAGER_CONFIG_PATH@" +#define MINICOREDUMPER_BIN_PATH "@MINICOREDUMPER_BIN_PATH@" +#define MINICOREDUMPER_CONFIG_PATH "@MINICOREDUMPER_CONFIG_PATH@" +#define DEBUGMODE_PATH "@DEBUGMODE_PATH@" + +#endif /* __DEFS_H__ */ diff --git a/src/crash-manager/CMakeLists.txt b/src/crash-manager/CMakeLists.txt index 8e6a356..49ae92b 100644 --- a/src/crash-manager/CMakeLists.txt +++ b/src/crash-manager/CMakeLists.txt @@ -26,7 +26,6 @@ ENDFOREACH(flag) SET(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${EXTRA_CFLAGS} -fPIE") -CONFIGURE_FILE(crash-manager.h.in crash-manager.h @ONLY) ADD_EXECUTABLE(${PROJECT_NAME} ${CRASH_MANAGER_SRCS}) TARGET_LINK_LIBRARIES(${PROJECT_NAME} ${crash-manager_pkgs_LDFLAGS} -pie -lrt) diff --git a/src/crash-manager/crash-manager.c b/src/crash-manager/crash-manager.c index 8aba8ae..0198901 100644 --- a/src/crash-manager/crash-manager.c +++ b/src/crash-manager/crash-manager.c @@ -41,7 +41,7 @@ #undef LOG_TAG #define LOG_TAG "CRASH_MANAGER" -#include "crash-manager.h" +#include "defs.h" #include "dbus_notify.h" #include "shared/log.h" #include "shared/spawn.h" diff --git a/src/crash-manager/crash-manager.h.in b/src/crash-manager/crash-manager.h.in deleted file mode 100644 index f5a8c4b..0000000 --- a/src/crash-manager/crash-manager.h.in +++ /dev/null @@ -1,33 +0,0 @@ -/* - * crash-manager - * - * Copyright (c) 2016 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. - */ - -#ifndef __CRASH_MANAGER_H__ -#define __CRASH_MANAGER_H__ - -/* Make build variables to string */ -#define CRASH_PATH "@CRASH_PATH@" -#define CRASH_ROOT_PATH "@CRASH_ROOT_PATH@" -#define CRASH_TEMP "@CRASH_TEMP@" -#define SYS_ASSERT "@SYS_ASSERT@" -#define CRASH_STACK_PATH "@CRASH_STACK_PATH@" -#define CRASH_MANAGER_CONFIG_PATH "@CRASH_MANAGER_CONFIG_PATH@" -#define MINICOREDUMPER_BIN_PATH "@MINICOREDUMPER_BIN_PATH@" -#define MINICOREDUMPER_CONFIG_PATH "@MINICOREDUMPER_CONFIG_PATH@" -#define DEBUGMODE_PATH "@DEBUGMODE_PATH@" - -#endif