Skip to content

Commit

Permalink
Now install local vcpkg dependencies at Python wheel building
Browse files Browse the repository at this point in the history
Make FETPAPI ready for AVRO 1.12 on MSVC (add /utf-8 compile options for libfmt)
  • Loading branch information
philippeVerney committed Nov 28, 2024
1 parent e44b275 commit 2b4ab41
Show file tree
Hide file tree
Showing 3 changed files with 24 additions and 11 deletions.
18 changes: 9 additions & 9 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,7 @@ target_compile_options(${PROJECT_NAME} PRIVATE
$<$<CXX_COMPILER_ID:MSVC>:/bigobj>
$<$<CXX_COMPILER_ID:MSVC>:/MP>
$<$<CXX_COMPILER_ID:MSVC>:/W4>
$<$<CXX_COMPILER_ID:MSVC>:/utf-8> # Necessary for fmt library which AVRO depends on
$<$<CXX_COMPILER_ID:GNU>:-Wall>
$<$<CXX_COMPILER_ID:GNU>:-Wextra>
$<$<CXX_COMPILER_ID:GNU>:-Wcast-qual>
Expand Down Expand Up @@ -110,6 +111,12 @@ endif()
if (WIN32 AND (Boost_VERSION_MAJOR EQUAL 1) AND (Boost_VERSION_MINOR LESS 74) AND (Boost_VERSION_MINOR GREATER 71))
message(WARNING "You may experience min/max issue with this boost version : See https://github.com/boostorg/beast/issues/1980")
endif ()
target_compile_definitions(${PROJECT_NAME} PRIVATE BOOST_ALL_NO_LIB)
if (DEFINED Boost_SYSTEM_LIBRARY)
target_link_libraries (${PROJECT_NAME} PRIVATE Boost::system)
else ()
target_link_libraries (${PROJECT_NAME} PRIVATE Boost::boost)
endif()

# avro DEPENDENCY
find_package(AVRO REQUIRED)
Expand All @@ -124,11 +131,7 @@ if (WITH_FESAPI)
endif (WITH_JAVA_WRAPPING)
endif (WITH_FESAPI)

target_compile_definitions(${PROJECT_NAME} PRIVATE BOOST_ALL_NO_LIB)
target_link_libraries (${PROJECT_NAME} PRIVATE AVRO::AVRO ${CMAKE_THREAD_LIBS_INIT})
if (DEFINED Boost_SYSTEM_LIBRARY)
target_link_libraries (${PROJECT_NAME} PRIVATE ${Boost_SYSTEM_LIBRARY})
endif()
if (WIN32)
target_link_libraries (${PROJECT_NAME} PRIVATE bcrypt.lib)

Expand Down Expand Up @@ -210,7 +213,7 @@ endif (WITH_FESAPI)

target_sources(${PROJECT_NAME} PRIVATE ${ALL_SOURCES_AND_HEADERS})

target_include_directories(${PROJECT_NAME} SYSTEM PRIVATE ${AVRO_INCLUDE_DIR} ${Boost_INCLUDE_DIR})
target_include_directories(${PROJECT_NAME} SYSTEM PRIVATE ${AVRO_INCLUDE_DIR})
if (WITH_ETP_SSL)
target_include_directories(${PROJECT_NAME} SYSTEM PRIVATE ${OPENSSL_INCLUDE_DIR})
endif ()
Expand Down Expand Up @@ -339,14 +342,11 @@ if (WITH_PYTHON_WRAPPING)
TARGETS ${PROJECT_NAME}
RUNTIME_DEPENDENCY_SET dep-set
)
cmake_path(GET SSL_EAY_RELEASE PARENT_PATH openSslLibPath)
cmake_path(GET openSslLibPath PARENT_PATH openSslPath)
cmake_path(APPEND openSslPath "bin" OUTPUT_VARIABLE openSslBinPath)
install(
RUNTIME_DEPENDENCY_SET dep-set
PRE_EXCLUDE_REGEXES "api-ms-.*" "ext-ms-.*" "[Ff]esapi[Cc]pp.*\\.dll"
POST_EXCLUDE_REGEXES ".*system32/.*\\.dll"
DIRECTORIES ${openSslBinPath}
DIRECTORIES ${CMAKE_BINARY_DIR}
RUNTIME DESTINATION ${CMAKE_SOURCE_DIR}/python/fetpapi/
)
ENDIF (WIN32)
Expand Down
15 changes: 14 additions & 1 deletion example/withFesapi/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,19 @@ target_include_directories (${PROJECT_NAME} PRIVATE ${CMAKE_SOURCE_DIR}/src/)
add_dependencies (${PROJECT_NAME} Fetpapi)
target_link_libraries (${PROJECT_NAME} PRIVATE Fetpapi)


target_compile_options(${PROJECT_NAME} PRIVATE
$<$<CXX_COMPILER_ID:MSVC>:/utf-8> # Necessary for fmt library which AVRO depends on
)

# Boost DEPENDENCY
target_compile_definitions(${PROJECT_NAME} PRIVATE BOOST_ALL_NO_LIB)
if (DEFINED Boost_SYSTEM_LIBRARY)
target_link_libraries (${PROJECT_NAME} PRIVATE Boost::system)
else ()
target_link_libraries (${PROJECT_NAME} PRIVATE Boost::boost)
endif()

target_compile_definitions(${PROJECT_NAME} PRIVATE BOOST_ALL_NO_LIB)
target_link_libraries (${PROJECT_NAME} PRIVATE AVRO::AVRO ${CMAKE_THREAD_LIBS_INIT})
if (DEFINED Boost_SYSTEM_LIBRARY)
Expand All @@ -42,7 +55,7 @@ if (WITH_ETP_SSL)
endif ()
target_link_libraries(${PROJECT_NAME} PRIVATE FESAPI::FESAPI)

target_include_directories(${PROJECT_NAME} SYSTEM PRIVATE ${AVRO_INCLUDE_DIR} ${Boost_INCLUDE_DIR})
target_include_directories(${PROJECT_NAME} SYSTEM PRIVATE ${AVRO_INCLUDE_DIR})
if (WITH_ETP_SSL)
target_include_directories(${PROJECT_NAME} SYSTEM PRIVATE ${OPENSSL_INCLUDE_DIR})
endif ()
Expand Down
2 changes: 1 addition & 1 deletion python/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ if (WITH_FESAPI)
set (FESAPI_LIBRARY_RELEASE_WLE ",'${FESAPI_LIBRARY_RELEASE_WLE}'")
endif ()
if (CMAKE_CXX_COMPILER_ID STREQUAL "MSVC")
set (EXTRA_COMPILE_ARGS "extra-compile-args=['/DSWIG_TYPE_TABLE=FESTAPI']")
set (EXTRA_COMPILE_ARGS "extra-compile-args=['/DSWIG_TYPE_TABLE=FESTAPI', '/utf-8']")
else ()
set (EXTRA_COMPILE_ARGS "extra-compile-args=['-DSWIG_TYPE_TABLE=FESTAPI', '-std=c++11']")
endif()
Expand Down

0 comments on commit 2b4ab41

Please sign in to comment.