From: Sangwan Kwon Date: Mon, 18 Nov 2019 03:26:42 +0000 (+0900) Subject: Detach common library X-Git-Tag: accepted/tizen/unified/20200810.122954~160 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=44089963a6329160d31ea37eb0322218112ea473;p=platform%2Fcore%2Fsecurity%2Fvist.git Detach common library Signed-off-by: Sangwan Kwon --- diff --git a/CMake/Macro.cmake b/CMake/Macro.cmake index d7e804d..326fd61 100644 --- a/CMake/Macro.cmake +++ b/CMake/Macro.cmake @@ -39,9 +39,15 @@ ENDMACRO(ADD_VIST_LIBRARY) MACRO(ADD_VIST_CLIENT_LIBRARY TARGET) ADD_LIBRARY(${TARGET} OBJECT ${ARGN}) LIST(APPEND ${TARGET_VIST_CLIENT_LIB}_SRCS $) - SET(${TARGET_VIST_LIB}_SRCS ${${TARGET_VIST_CLIENT_LIB}_SRCS} PARENT_SCOPE) + SET(${TARGET_VIST_CLIENT_LIB}_SRCS ${${TARGET_VIST_CLIENT_LIB}_SRCS} PARENT_SCOPE) ENDMACRO(ADD_VIST_CLIENT_LIBRARY) +MACRO(ADD_VIST_COMMON_LIBRARY TARGET) + ADD_LIBRARY(${TARGET} OBJECT ${ARGN}) + LIST(APPEND ${TARGET_VIST_COMMON_LIB}_SRCS $) + SET(${TARGET_VIST_COMMON_LIB}_SRCS ${${TARGET_VIST_COMMON_LIB}_SRCS} PARENT_SCOPE) +ENDMACRO(ADD_VIST_COMMON_LIBRARY) + MACRO(ADD_VIST_POLICY_LIBRARY TARGET) ADD_LIBRARY(${TARGET} OBJECT ${ARGN}) LIST(APPEND ${TARGET_VIST_POLICY_LIB}_SRCS $) diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index 52f231e..1648043 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -14,6 +14,7 @@ SET(TARGET_OSQUERY_LIB osquery) SET(TARGET_VIST_CLIENT_LIB vist-client) +SET(TARGET_VIST_COMMON_LIB vist-common) SET(TARGET_VIST_LIB vist) SET(TARGET_VIST_POLICY_LIB vist-policy) diff --git a/src/vist/CMakeLists.txt b/src/vist/CMakeLists.txt index 66bfde5..e4c7c9c 100644 --- a/src/vist/CMakeLists.txt +++ b/src/vist/CMakeLists.txt @@ -18,6 +18,7 @@ SET(TARGET_VIST_TEST vist-test) SET(${TARGET_VIST_LIB}_SRCS "") SET(${TARGET_VIST_LIB}_TESTS "") +SET(${TARGET_VIST_COMMON_LIB}_SRCS "") SET(DEPENDENCY klay dlog gflags) @@ -31,6 +32,8 @@ ADD_DEFINITIONS(-DDB_PATH="${DB_INSTALL_DIR}/.vist.db" -DSCRIPT_INSTALL_DIR="${SCRIPT_INSTALL_DIR}") ADD_SUBDIRECTORY(client) +ADD_SUBDIRECTORY(common) +ADD_SUBDIRECTORY(ipc) ADD_SUBDIRECTORY(notification) ADD_SUBDIRECTORY(policy) ADD_SUBDIRECTORY(sdk) @@ -70,12 +73,11 @@ INSTALL(TARGETS ${TARGET_VIST_CLI} WORLD_READ WORLD_EXECUTE) -FILE(GLOB COMMON_TESTS "tests/*.cpp") -ADD_VIST_TEST(${COMMON_TESTS}) - ADD_EXECUTABLE(${TARGET_VIST_TEST} main/tests.cpp ${${TARGET_VIST_LIB}_TESTS}) TARGET_LINK_LIBRARIES(${TARGET_VIST_TEST} ${TARGET_VIST_LIB} + ${TARGET_VIST_CLIENT_LIB} + ${TARGET_VIST_COMMON_LIB} gtest) TARGET_LINK_WHOLE(${TARGET_VIST_TEST} ${TARGET_OSQUERY_LIB}) ADD_TEST(${TARGET_VIST_TEST} ${TARGET_VIST_TEST}) diff --git a/src/vist/common/CMakeLists.txt b/src/vist/common/CMakeLists.txt new file mode 100644 index 0000000..c76ae24 --- /dev/null +++ b/src/vist/common/CMakeLists.txt @@ -0,0 +1,26 @@ +# Copyright (c) 2019 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. +# 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 + +PKG_CHECK_MODULES(VIST_COMMON_DEPS REQUIRED gflags klay dlog) + +INCLUDE_DIRECTORIES(SYSTEM . ${VIST_COMMON_DEPS_INCLUDE_DIRS}) + +ADD_VIST_COMMON_LIBRARY(vist_common common.cpp) + +FILE(GLOB COMMON_TESTS "tests/*.cpp") +ADD_VIST_TEST(${COMMON_TESTS}) + +ADD_LIBRARY(${TARGET_VIST_COMMON_LIB} STATIC ${${TARGET_VIST_COMMON_LIB}_SRCS}) +TARGET_LINK_LIBRARIES(${TARGET_VIST_COMMON_LIB} ${VIST_COMMON_DEPS_LIBRARIES} + pthread) diff --git a/src/vist/common/common.cpp b/src/vist/common/common.cpp new file mode 100644 index 0000000..14ffe17 --- /dev/null +++ b/src/vist/common/common.cpp @@ -0,0 +1,19 @@ +/* + * Copyright (c) 2019 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. + * 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 + */ + +#include +#include +#include diff --git a/src/vist/tests/exception.cpp b/src/vist/common/tests/exception.cpp similarity index 100% rename from src/vist/tests/exception.cpp rename to src/vist/common/tests/exception.cpp diff --git a/src/vist/tests/logger.cpp b/src/vist/common/tests/logger.cpp similarity index 100% rename from src/vist/tests/logger.cpp rename to src/vist/common/tests/logger.cpp diff --git a/src/vist/tests/result.cpp b/src/vist/common/tests/result.cpp similarity index 100% rename from src/vist/tests/result.cpp rename to src/vist/common/tests/result.cpp diff --git a/src/vist/ipc/CMakeLists.txt b/src/vist/ipc/CMakeLists.txt new file mode 100644 index 0000000..616a117 --- /dev/null +++ b/src/vist/ipc/CMakeLists.txt @@ -0,0 +1,16 @@ +# Copyright (c) 2019 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. +# 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. +# + +ADD_VIST_COMMON_LIBRARY(vist_ipc ipc.cpp) diff --git a/src/vist/ipc/ipc.cpp b/src/vist/ipc/ipc.cpp new file mode 100644 index 0000000..2a92627 --- /dev/null +++ b/src/vist/ipc/ipc.cpp @@ -0,0 +1,18 @@ +/* + * Copyright (c) 2019 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. + * 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 + */ + +#include +#include diff --git a/src/vist/query-builder/CMakeLists.txt b/src/vist/query-builder/CMakeLists.txt index 5f41c24..3965ab0 100644 --- a/src/vist/query-builder/CMakeLists.txt +++ b/src/vist/query-builder/CMakeLists.txt @@ -12,6 +12,8 @@ # See the License for the specific language governing permissions and # limitations under the License +ADD_VIST_COMMON_LIBRARY(vist_query_builder query-builder.cpp) + /// TSQB: Type Safe Query Builder FILE(GLOB TSQB_TESTS "tests/*.cpp") ADD_VIST_TEST(${TSQB_TESTS}) diff --git a/src/vist/query-builder/query-builder.cpp b/src/vist/query-builder/query-builder.cpp new file mode 100644 index 0000000..21f34b0 --- /dev/null +++ b/src/vist/query-builder/query-builder.cpp @@ -0,0 +1,17 @@ +/* + * Copyright (c) 2019 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. + * 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 + */ + +#include diff --git a/src/vist/sdk/CMakeLists.txt b/src/vist/sdk/CMakeLists.txt index 5e233cf..a370c59 100644 --- a/src/vist/sdk/CMakeLists.txt +++ b/src/vist/sdk/CMakeLists.txt @@ -13,5 +13,7 @@ # limitations under the License. # +ADD_VIST_COMMON_LIBRARY(vist_sdk sdk.cpp) + FILE(GLOB POLICY_SDK_TESTS "tests/*.cpp") ADD_VIST_TEST(${POLICY_SDK_TESTS}) diff --git a/src/vist/sdk/sdk.cpp b/src/vist/sdk/sdk.cpp new file mode 100644 index 0000000..ab97ed9 --- /dev/null +++ b/src/vist/sdk/sdk.cpp @@ -0,0 +1,19 @@ +/* + * Copyright (c) 2019 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. + * 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 + */ + +#include +#include +#include