Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

set the path for ffi headers (cmake build) #2970

Closed
wants to merge 8 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 5 additions & 1 deletion M2/cmake/FindBDWGC.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -80,8 +80,12 @@ if(NOT BDWGC_VERSION_OK)
)
endif()

# check that bdwg-gc has C++ support installed (it must be configured with --enable-cplusplus)
set(CMAKE_REQUIRED_INCLUDES "${BDWGC_INCLUDE_DIR}")
check_include_files(gc/gc_cpp.h BDWGC_CXX_SUPPORT LANGUAGE CXX)

include(FindPackageHandleStandardArgs)
find_package_handle_standard_args(BDWGC DEFAULT_MSG BDWGC_INCLUDE_DIR BDWGC_LIBRARIES BDWGC_VERSION_OK)
find_package_handle_standard_args(BDWGC DEFAULT_MSG BDWGC_INCLUDE_DIR BDWGC_LIBRARIES BDWGC_VERSION_OK BDWGC_CXX_SUPPORT)

mark_as_advanced(BDWGC_INCLUDE_DIR BDWGC_LIBRARIES)

Expand Down
8 changes: 6 additions & 2 deletions M2/cmake/check-libraries.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -80,9 +80,13 @@ if(WITH_TBB)
endif()

if(WITH_FFI)
pkg_get_variable(FFI_INCLUDE_DIR libffi includedir)
find_package(FFI REQUIRED QUIET)
execute_process(COMMAND pkg-config --modversion libffi
OUTPUT_VARIABLE LIBFFI_VERSION OUTPUT_STRIP_TRAILING_WHITESPACE)
if(NOT DEFINED LIBFFI_VERSION)
execute_process(COMMAND pkg-config --modversion libffi
OUTPUT_VARIABLE LIBFFI_VERSION_ OUTPUT_STRIP_TRAILING_WHITESPACE)
set(LIBFFI_VERSION ${LIBFFI_VERSION_} CACHE STRING "FFI version")
endif()
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think it would be much cleaner if this code block was inside FindFFI.cmake. FindModules are usually supposed to set the version variable anyway, so this would be an improvement to the current one.

else()
set(LIBFFI_VERSION "not present")
endif()
Expand Down
Loading