Skip to content

Commit

Permalink
quickfast: fix compilation issues
Browse files Browse the repository at this point in the history
  • Loading branch information
valgur committed Nov 3, 2023
1 parent 3813208 commit 879de85
Show file tree
Hide file tree
Showing 7 changed files with 57 additions and 100 deletions.
10 changes: 8 additions & 2 deletions recipes/quickfast/all/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,9 @@ file(GLOB HEADERS RELATIVE ${PROJECT_SOURCE_DIR}

add_library(quickfast ${HEADERS} ${SOURCES})

# Needed to keep support for deprecated placeholders in boost::bind
target_compile_definitions(quickfast PRIVATE -DBOOST_BIND_GLOBAL_PLACEHOLDERS)

if(BUILD_SHARED_LIBS)
target_compile_definitions(quickfast PRIVATE -DQUICKFAST_BUILD_DLL)
else()
Expand All @@ -58,8 +61,11 @@ target_compile_features(quickfast PUBLIC cxx_std_11)
target_include_directories(quickfast PUBLIC src/src)
target_link_libraries(${PROJECT_NAME} Boost::boost XercesC::XercesC)

include(GNUInstallDirs)
install(TARGETS quickfast)
install(TARGETS quickfast
RUNTIME DESTINATION bin
LIBRARY DESTINATION lib
ARCHIVE DESTINATION lib
)

foreach (HEADER ${HEADERS})
file(RELATIVE_PATH HEADER_REL ${PROJECT_SOURCE_DIR}/src/src ${PROJECT_SOURCE_DIR}/${HEADER})
Expand Down
16 changes: 10 additions & 6 deletions recipes/quickfast/all/conandata.yml
Original file line number Diff line number Diff line change
@@ -1,12 +1,16 @@
sources:
"1.5":
url: "https://github.com/objectcomputing/quickfast/archive/V1_5.tar.gz"
sha256: "7ae22d28cc13967a2815c09bec027ce01f2f3e30b6ed752bea00649581e728df"
"cci.20170314":
url: "https://github.com/objectcomputing/quickfast/archive/f9403cfb20ae5383a04772112728d233502e31c0.tar.gz"
sha256: "29f40fa383643bfa381315148c6c985fe41159342706f0d0a274fcf45cf36f49"
patches:
"1.5":
- patch_file: "patches/00001-fix-boost-asio.patch"
url: "https://github.com/objectcomputing/quickfast/archive/V1_5.tar.gz"
sha256: "7ae22d28cc13967a2815c09bec027ce01f2f3e30b6ed752bea00649581e728df"
patches:
"cci.20170314":
- patch_file: "patches/00002-fix-boost-asio.patch"
- patch_file: "patches/1.5-fix-boost-asio.patch"
patch_type: "portability"
patch_description: "Fix compilation issues with newer Boost.Asio"
"1.5":
- patch_file: "patches/1.5-fix-boost-asio.patch"
patch_type: "portability"
patch_description: "Fix compilation issues with newer Boost.Asio"
13 changes: 7 additions & 6 deletions recipes/quickfast/all/conanfile.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
from conan import ConanFile
from conan.tools.build import check_min_cppstd
from conan.tools.cmake import CMake, CMakeDeps, CMakeToolchain, cmake_layout
from conan.tools.files import apply_conandata_patches, collect_libs, copy, export_conandata_patches, get
from conan.tools.files import apply_conandata_patches, copy, export_conandata_patches, get

required_conan_version = ">=1.53.0"

Expand All @@ -14,7 +14,7 @@ class QuickfastConan(ConanFile):
license = "BSD-3-Clause"
url = "https://github.com/conan-io/conan-center-index"
homepage = "https://objectcomputing.com/"
topics = ("conan", "QuickFAST", "FAST", "FIX", "Fix Adapted for STreaming", "Financial Information Exchange", "libraries", "cpp")
topics = ("QuickFAST", "FAST", "FIX", "Fix Adapted for STreaming", "Financial Information Exchange")

package_type = "library"
settings = "os", "arch", "compiler", "build_type"
Expand All @@ -39,7 +39,8 @@ def layout(self):
cmake_layout(self, src_folder="src")

def requirements(self):
self.requires("boost/1.83.0")
# Uses Boost.Asio transitively
self.requires("boost/1.83.0", transitive_headers=True, transitive_libs=True)
self.requires("xerces-c/3.2.4")

def validate(self):
Expand All @@ -58,8 +59,8 @@ def generate(self):
def build(self):
apply_conandata_patches(self)
cmake = CMake(self)
cmake.configure(build_script_folder=self.export_sources_folder)
cmake.build(target="quickfast")
cmake.configure(build_script_folder=self.source_path.parent)
cmake.build()

def package(self):
cmake = CMake(self)
Expand All @@ -69,7 +70,7 @@ def package(self):
src=self.source_folder)

def package_info(self):
self.cpp_info.libs = collect_libs(self)
self.cpp_info.libs = ["quickfast"]
self.cpp_info.includedirs.append(os.path.join("include", "quickfast"))

if not self.options.shared:
Expand Down
42 changes: 0 additions & 42 deletions recipes/quickfast/all/patches/00001-fix-boost-asio.patch

This file was deleted.

42 changes: 0 additions & 42 deletions recipes/quickfast/all/patches/00002-fix-boost-asio.patch

This file was deleted.

30 changes: 30 additions & 0 deletions recipes/quickfast/all/patches/1.5-fix-boost-asio.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
--- src/Communication/AsioService_fwd.h
+++ src/Communication/AsioService_fwd.h
@@ -11,15 +11,7 @@
#error Please include <Application/QuickFAST.h> preferably as a precompiled header file.
#endif //QUICKFAST_HEADERS

-// forward declare io_service without including
-// boost header
-namespace boost
-{
- namespace asio
- {
- class io_service;
- }
-}
+#include <boost/asio/io_service.hpp>

namespace QuickFAST
{
--- src/Communication/AsioService.h
+++ src/Communication/AsioService.h
@@ -24,7 +24,7 @@
/// Normal case is for all classes derived from AsioService to share
/// the same boost::io_service. The alternate constructor gives the
/// application more control if it is needed.
- class QuickFAST_Export AsioService
+ class QuickFAST_Export AsioService : public boost::asio::io_service
{
public:
/// @brief Construct using the internal, common io service
4 changes: 2 additions & 2 deletions recipes/quickfast/config.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
versions:
"1.5":
folder: all
"cci.20170314":
folder: all
"1.5":
folder: all

0 comments on commit 879de85

Please sign in to comment.