Introduce defs.h with all cmake variables 28/203428/1
authorKarol Lewandowski <k.lewandowsk@samsung.com>
Tue, 26 Mar 2019 14:00:42 +0000 (15:00 +0100)
committerKarol Lewandowski <k.lewandowsk@samsung.com>
Fri, 12 Apr 2019 09:27:31 +0000 (11:27 +0200)
Change-Id: Ic3fb4f3d6074b896f7601d07a7a93cb96f9e8727

CMakeLists.txt
include/CMakeLists.txt [new file with mode: 0644]
include/defs.h.in [new file with mode: 0644]
src/crash-manager/CMakeLists.txt
src/crash-manager/crash-manager.c
src/crash-manager/crash-manager.h.in [deleted file]

index 8003dae..49a9356 100644 (file)
@@ -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 (file)
index 0000000..ce9314c
--- /dev/null
@@ -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 (file)
index 0000000..25e465e
--- /dev/null
@@ -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__ */
index 8e6a356..49ae92b 100644 (file)
@@ -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)
 
index 8aba8ae..0198901 100644 (file)
@@ -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 (file)
index f5a8c4b..0000000
+++ /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