mirror of
https://github.com/microsoft/vcpkg.git
synced 2025-01-18 13:13:34 +08:00
[quickfast] Add new port (#7814)
* quickfast * replace 'noexcept' with BOOST_ASIO_NOEXCEPT
This commit is contained in:
parent
95f9df7134
commit
9241e6c4b2
39
ports/quickfast/00001-fix-boost-asio.patch
Normal file
39
ports/quickfast/00001-fix-boost-asio.patch
Normal file
@ -0,0 +1,39 @@
|
||||
diff --git a/src/Common/QuickFASTPch.h b/src/Common/QuickFASTPch.h
|
||||
index 3574df8..c4ef4e1 100644
|
||||
--- a/src/Common/QuickFASTPch.h
|
||||
+++ b/src/Common/QuickFASTPch.h
|
||||
@@ -32,7 +32,7 @@
|
||||
#include <string.h>
|
||||
|
||||
// If building for .NET, must link boost threads dynamically
|
||||
-#define BOOST_THREAD_USE_DLL
|
||||
+// #define BOOST_THREAD_USE_DLL
|
||||
// This reports at compile time which boost libraries will be used
|
||||
// #define BOOST_LIB_DIAGNOSTIC
|
||||
|
||||
diff --git a/src/Communication/AsioService.h b/src/Communication/AsioService.h
|
||||
index 4f61915..96f2198 100644
|
||||
--- a/src/Communication/AsioService.h
|
||||
+++ b/src/Communication/AsioService.h
|
||||
@@ -99,6 +99,7 @@ namespace QuickFAST
|
||||
{
|
||||
return ioService_;
|
||||
}
|
||||
+ boost::asio::io_service::executor_type get_executor() BOOST_ASIO_NOEXCEPT { return ioService_.get_executor();}
|
||||
|
||||
///@brief Post a completion handler for later processing (usually in a different thread)
|
||||
/// @param handler is the handler to be posted
|
||||
diff --git a/src/Communication/AsioService_fwd.h b/src/Communication/AsioService_fwd.h
|
||||
index dc2f235..6ad5e68 100644
|
||||
--- a/src/Communication/AsioService_fwd.h
|
||||
+++ b/src/Communication/AsioService_fwd.h
|
||||
@@ -17,7 +17,8 @@ namespace boost
|
||||
{
|
||||
namespace asio
|
||||
{
|
||||
- class io_service;
|
||||
+ class io_context;
|
||||
+ typedef io_context io_service;
|
||||
}
|
||||
}
|
||||
|
54
ports/quickfast/CMakeLists.txt
Normal file
54
ports/quickfast/CMakeLists.txt
Normal file
@ -0,0 +1,54 @@
|
||||
cmake_minimum_required(VERSION 3.13)
|
||||
project(quickfast CXX)
|
||||
|
||||
option(BUILD_SHARED_LIBS "Build shared instead of static library" ON)
|
||||
|
||||
find_package(Boost REQUIRED COMPONENTS thread)
|
||||
find_package(XercesC REQUIRED)
|
||||
|
||||
file(GLOB SOURCES
|
||||
quickfast/Application/*.cpp
|
||||
quickfast/Common/*.cpp
|
||||
quickfast/Codecs/*.cpp
|
||||
quickfast/Communication/*.cpp
|
||||
quickfast/Messages/*.cpp
|
||||
)
|
||||
|
||||
file(GLOB HEADERS RELATIVE ${CMAKE_CURRENT_SOURCE_DIR}
|
||||
quickfast/Application/*.h
|
||||
quickfast/Common/*.h
|
||||
quickfast/Codecs/*.h
|
||||
quickfast/Communication/*.h
|
||||
quickfast/Messages/*.h
|
||||
)
|
||||
|
||||
if(BUILD_SHARED_LIBS)
|
||||
add_library(quickfast SHARED ${HEADERS} ${SOURCES})
|
||||
target_compile_definitions(quickfast PRIVATE -DQUICKFAST_BUILD_DLL)
|
||||
else()
|
||||
add_library(quickfast STATIC ${HEADERS} ${SOURCES})
|
||||
target_compile_definitions(quickfast PUBLIC -DQUICKFAST_HAS_DLL=0)
|
||||
endif()
|
||||
|
||||
target_include_directories(quickfast PUBLIC
|
||||
$<INSTALL_INTERFACE:include>
|
||||
$<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}>
|
||||
$<BUILD_INTERFACE:${Boost_INCLUDE_DIRS}>
|
||||
)
|
||||
|
||||
target_link_libraries(quickfast PRIVATE
|
||||
${Boost_LIBRARIES}
|
||||
XercesC::XercesC
|
||||
)
|
||||
|
||||
install(TARGETS quickfast EXPORT quickfast-config
|
||||
RUNTIME DESTINATION bin
|
||||
ARCHIVE DESTINATION lib
|
||||
LIBRARY DESTINATION lib
|
||||
)
|
||||
install(EXPORT quickfast-config DESTINATION share/cmake/quickfast)
|
||||
|
||||
foreach (HEADER ${HEADERS} )
|
||||
get_filename_component(HEADER_DIR ${HEADER} DIRECTORY)
|
||||
install(FILES ${HEADER} DESTINATION include/${HEADER_DIR})
|
||||
endforeach()
|
5
ports/quickfast/CONTROL
Normal file
5
ports/quickfast/CONTROL
Normal file
@ -0,0 +1,5 @@
|
||||
Source: quickfast
|
||||
Version: 1.5
|
||||
Build-Depends: boost-asio, xerces-c
|
||||
Homepage: https://github.com/objectcomputing/quickfast
|
||||
Description: QuickFAST is an Open Source native C++ implementation of the FAST Protocol [SM].
|
50
ports/quickfast/portfile.cmake
Normal file
50
ports/quickfast/portfile.cmake
Normal file
@ -0,0 +1,50 @@
|
||||
include(vcpkg_common_functions)
|
||||
|
||||
vcpkg_from_github(
|
||||
OUT_SOURCE_PATH SOURCE_PATH
|
||||
REPO objectcomputing/quickfast
|
||||
REF V1_5
|
||||
SHA512 f224ffbe0ee1b84616b46d536d27da01346103cf9ed135a87543da51e8e979ec3735e08ece8525ee1316ea323d41dcacc4d44eabe2e033d68f93432ea43d1ce9
|
||||
HEAD_REF master
|
||||
PATCHES 00001-fix-boost-asio.patch
|
||||
)
|
||||
|
||||
file(COPY ${CMAKE_CURRENT_LIST_DIR}/CMakeLists.txt DESTINATION ${SOURCE_PATH})
|
||||
|
||||
if(NOT EXISTS "${SOURCE_PATH}/quickfast")
|
||||
file(RENAME ${SOURCE_PATH}/src ${SOURCE_PATH}/quickfast)
|
||||
endif()
|
||||
|
||||
file(GLOB_RECURSE SRC_FILES "${SOURCE_PATH}/quickfast/*.cpp" "${SOURCE_PATH}/quickfast/*.h")
|
||||
foreach(SRC_FILE IN LISTS SRC_FILES)
|
||||
file(READ "${SRC_FILE}" _contents)
|
||||
string(REPLACE "#include <Common/" "#include <quickfast/Common/" _contents "${_contents}")
|
||||
string(REPLACE "#include <Application/" "#include <quickfast/Application/" _contents "${_contents}")
|
||||
string(REPLACE "#include <Communication/" "#include <quickfast/Communication/" _contents "${_contents}")
|
||||
string(REPLACE "#include <Codecs/" "#include <quickfast/Codecs/" _contents "${_contents}")
|
||||
string(REPLACE "#include <Messages/" "#include <quickfast/Messages/" _contents "${_contents}")
|
||||
file(WRITE "${SRC_FILE}" "${_contents}")
|
||||
endforeach()
|
||||
|
||||
if(VCPKG_LIBRARY_LINKAGE STREQUAL dynamic)
|
||||
set(BUILD_SHARED_LIBS ON)
|
||||
else()
|
||||
set(BUILD_SHARED_LIBS OFF)
|
||||
endif()
|
||||
|
||||
vcpkg_configure_cmake(
|
||||
SOURCE_PATH ${SOURCE_PATH}
|
||||
OPTIONS
|
||||
-DBUILD_SHARED_LIBS=${BUILD_SHARED_LIBS}
|
||||
PREFER_NINJA
|
||||
)
|
||||
|
||||
vcpkg_install_cmake()
|
||||
vcpkg_copy_pdbs()
|
||||
vcpkg_fixup_cmake_targets(CONFIG_PATH share/cmake/quickfast)
|
||||
|
||||
file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/debug/include)
|
||||
file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/debug/share)
|
||||
|
||||
configure_file(${SOURCE_PATH}/license.txt ${CURRENT_PACKAGES_DIR}/share/quickfast/copyright COPYONLY)
|
||||
file(COPY ${CMAKE_CURRENT_LIST_DIR}/usage DESTINATION ${CURRENT_PACKAGES_DIR}/share/quickfast)
|
4
ports/quickfast/usage
Normal file
4
ports/quickfast/usage
Normal file
@ -0,0 +1,4 @@
|
||||
The package quickfast provides CMake targets:
|
||||
|
||||
find_package(quickfast CONFIG REQUIRED)
|
||||
target_link_libraries(main PRIVATE quickfast)
|
Loading…
Reference in New Issue
Block a user