Fix stand-alone build for CI
Tested:
Passed the docker build.
Change-Id: If35676832ae68ed805aeeb757022a5e050f7f833
Signed-off-by: Jason M. Bills <jason.m.bills@intel.com>
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 4397728..83d2dcd 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -1,10 +1,30 @@
cmake_minimum_required (VERSION 3.6)
project (peci-pcie CXX)
+include (ExternalProject)
set (CMAKE_CXX_STANDARD 17)
set (CMAKE_CXX_STANDARD_REQUIRED ON)
add_executable (peci-pcie src/peci_pcie.cpp)
+option (YOCTO "Enable Building in Yocto" OFF)
+
+if (NOT YOCTO)
+ add_dependencies (peci-pcie libpeci)
+ externalproject_add (libpeci PREFIX ${CMAKE_BINARY_DIR}/libpeci
+ GIT_REPOSITORY https://github.com/openbmc/libpeci.git
+ GIT_TAG bc641112abc99b4a972665aa984023a6713a21ac
+ INSTALL_COMMAND "")
+
+ externalproject_get_property (libpeci SOURCE_DIR)
+ include_directories (${SOURCE_DIR})
+
+ externalproject_get_property (libpeci BINARY_DIR)
+ add_library (peci SHARED IMPORTED)
+ set_target_properties (peci
+ PROPERTIES IMPORTED_LOCATION
+ ${BINARY_DIR}/libpeci.so)
+endif ()
+
target_include_directories (peci-pcie PRIVATE ${CMAKE_SOURCE_DIR})
target_link_libraries (peci-pcie peci sdbusplus -lsystemd)
diff --git a/src/peci_pcie.cpp b/src/peci_pcie.cpp
index 4f45243..fa42ea6 100644
--- a/src/peci_pcie.cpp
+++ b/src/peci_pcie.cpp
@@ -19,6 +19,8 @@
#include "pciDeviceClass.hpp"
#include "pciVendors.hpp"
+#include <boost/asio/io_service.hpp>
+#include <boost/asio/steady_timer.hpp>
#include <boost/container/flat_map.hpp>
#include <boost/container/flat_set.hpp>
#include <sdbusplus/asio/object_server.hpp>