2017-08-20 09:44:38 +00:00
|
|
|
# Copyright (c) 2014-present, Facebook, Inc.
|
|
|
|
# All rights reserved.
|
|
|
|
#
|
|
|
|
# This source code is licensed under the BSD-style license found in the
|
|
|
|
# LICENSE file in the root directory of this source tree. An additional grant
|
|
|
|
# of patent rights can be found in the PATENTS file in the same directory.
|
|
|
|
|
2015-02-04 03:55:16 +00:00
|
|
|
# Generate the thrift intermediate/interface code.
|
2017-05-21 17:59:19 +00:00
|
|
|
if(LINUX OR DARWIN)
|
|
|
|
add_custom_command(
|
|
|
|
COMMAND
|
|
|
|
LD_LIBRARY_PATH=${BUILD_DEPS}/lib:$ENV{LD_LIBRARY_PATH}
|
|
|
|
${THRIFT_COMPILER} --gen cpp --gen py "${CMAKE_SOURCE_DIR}/osquery.thrift"
|
|
|
|
DEPENDS "${CMAKE_SOURCE_DIR}/osquery.thrift"
|
|
|
|
WORKING_DIRECTORY "${CMAKE_BINARY_DIR}/generated"
|
|
|
|
OUTPUT ${OSQUERY_THRIFT_GENERATED_FILES}
|
|
|
|
)
|
|
|
|
else()
|
|
|
|
add_custom_command(
|
|
|
|
COMMAND
|
|
|
|
${THRIFT_COMPILER} --gen cpp --gen py "${CMAKE_SOURCE_DIR}/osquery.thrift"
|
|
|
|
DEPENDS "${CMAKE_SOURCE_DIR}/osquery.thrift"
|
|
|
|
WORKING_DIRECTORY "${CMAKE_BINARY_DIR}/generated"
|
|
|
|
OUTPUT ${OSQUERY_THRIFT_GENERATED_FILES}
|
|
|
|
)
|
|
|
|
endif()
|
2015-02-04 03:55:16 +00:00
|
|
|
|
2016-08-10 21:06:47 +00:00
|
|
|
if(NOT WINDOWS)
|
2016-04-15 21:01:16 +00:00
|
|
|
add_compile_options(
|
|
|
|
-Wno-macro-redefined
|
|
|
|
)
|
|
|
|
endif()
|
2015-10-08 14:22:48 +00:00
|
|
|
|
2015-02-05 00:54:44 +00:00
|
|
|
ADD_OSQUERY_LIBRARY(TRUE osquery_extensions
|
2015-02-04 03:55:16 +00:00
|
|
|
${OSQUERY_THRIFT_GENERATED_FILES}
|
2015-02-05 00:54:44 +00:00
|
|
|
extensions.cpp
|
2015-02-19 23:19:00 +00:00
|
|
|
interface.cpp
|
2015-02-04 03:55:16 +00:00
|
|
|
)
|
|
|
|
|
2015-04-27 09:12:58 +00:00
|
|
|
file(GLOB OSQUERY_EXTENSIONS_TESTS "tests/*.cpp")
|
|
|
|
ADD_OSQUERY_TEST(TRUE ${OSQUERY_EXTENSIONS_TESTS})
|