MACRO(ADD_VIST_CLIENT_LIBRARY TARGET)
ADD_LIBRARY(${TARGET} OBJECT ${ARGN})
LIST(APPEND ${TARGET_VIST_CLIENT_LIB}_SRCS $<TARGET_OBJECTS:${TARGET}>)
- 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 $<TARGET_OBJECTS:${TARGET}>)
+ 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 $<TARGET_OBJECTS:${TARGET}>)
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)
SET(${TARGET_VIST_LIB}_SRCS "")
SET(${TARGET_VIST_LIB}_TESTS "")
+SET(${TARGET_VIST_COMMON_LIB}_SRCS "")
SET(DEPENDENCY klay dlog gflags)
-DSCRIPT_INSTALL_DIR="${SCRIPT_INSTALL_DIR}")
ADD_SUBDIRECTORY(client)
+ADD_SUBDIRECTORY(common)
+ADD_SUBDIRECTORY(ipc)
ADD_SUBDIRECTORY(notification)
ADD_SUBDIRECTORY(policy)
ADD_SUBDIRECTORY(sdk)
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})
--- /dev/null
+# 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)
--- /dev/null
+/*
+ * 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 <vist/exception.hpp>
+#include <vist/logger.hpp>
+#include <vist/result.hpp>
--- /dev/null
+# 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)
--- /dev/null
+/*
+ * 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 <vist/ipc/client.hpp>
+#include <vist/ipc/server.hpp>
# 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})
--- /dev/null
+/*
+ * 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 <vist/query-builder.hpp>
# 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})
--- /dev/null
+/*
+ * 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 <vist/sdk/policy-model.hpp>
+#include <vist/sdk/policy-provider.hpp>
+#include <vist/sdk/policy-value.hpp>