Skip to content

Commit

Permalink
ARROW-8373: [CI][GLib] Find gio-2.0 manually on macOS
Browse files Browse the repository at this point in the history
Because "pkg-config --cflags gio-2.0" includes the "-I$(xcrun
--show-sdk-path)/usr/include" flag by zlib.pc. The include path
includes the standard C headers such as stdlib.h. It confuses
clang++ (/usr/bin/c++).

This also removes needless gio-2.0 dependency from arrow-glib.pc.

Closes #6886 from kou/ci-glib-macos

Authored-by: Sutou Kouhei <kou@clear-code.com>
Signed-off-by: Neal Richardson <neal.p.richardson@gmail.com>
  • Loading branch information
kou authored and nealrichardson committed Apr 9, 2020
1 parent 9662dd6 commit 625375a
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 10 deletions.
2 changes: 1 addition & 1 deletion c_glib/arrow-glib/arrow-glib.pc.in
Expand Up @@ -25,4 +25,4 @@ Description: C API for Apache Arrow based on GLib
Version: @VERSION@
Libs: -L${libdir} -larrow-glib
Cflags: -I${includedir}
Requires: gio-2.0 arrow
Requires: gobject-2.0 arrow
16 changes: 13 additions & 3 deletions c_glib/arrow-glib/meson.build
Expand Up @@ -207,10 +207,20 @@ headers = c_headers + cpp_headers
install_headers(headers, subdir: meson.project_name())


gobject = dependency('gobject-2.0')
gobject_libdir = gobject.get_variable(pkgconfig: 'libdir')
# This is for Homebrew. "pkg-config --cflags gio-2.0" includes the
# "-I$(xcrun --show-sdk-path)/usr/include" flag by zlib.pc. The
# include path includes the standard C headers such as stdlib.h. It
# confuses clang++ (/usr/bin/c++).
gio = cxx.find_library('gio-2.0', dirs: [gobject_libdir], required: false)
if not gio.found()
gio = dependency('gio-2.0')
endif
dependencies = [
arrow,
dependency('gobject-2.0'),
dependency('gio-2.0'),
gobject,
gio,
]
libarrow_glib = library('arrow-glib',
sources: sources + enums,
Expand All @@ -229,7 +239,7 @@ pkgconfig.generate(libarrow_glib,
name: 'Apache Arrow GLib',
description: 'C API for Apache Arrow based on GLib',
version: version,
requires: ['gio-2.0', 'arrow'])
requires: ['gobject-2.0', 'arrow'])
if have_arrow_orc
pkgconfig.generate(filebase: 'arrow-orc-glib',
name: 'Apache Arrow GLib ORC',
Expand Down
6 changes: 0 additions & 6 deletions ci/scripts/c_glib_build.sh
Expand Up @@ -26,12 +26,6 @@ build_dir=${2}/c_glib

export PKG_CONFIG_PATH=${ARROW_HOME}/lib/pkgconfig

if which brew > /dev/null 2>&1; then
export $(echo env | brew sh | grep "^HOMEBREW_SDKROOT=")
export $(echo env | brew sh | grep "^PKG_CONFIG=")
PKG_CONFIG_PATH=${PKG_CONFIG_PATH}:$(echo 'echo $PKG_CONFIG_LIBDIR' | brew sh)
fi

export CFLAGS="-DARROW_NO_DEPRECATED_API"
export CXXFLAGS="-DARROW_NO_DEPRECATED_API"

Expand Down

0 comments on commit 625375a

Please sign in to comment.