You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@arrow.apache.org by we...@apache.org on 2019/06/04 01:38:48 UTC

[arrow] branch master updated: ARROW-5498: [C++][CI] Fix Flatbuffers related error with MinGW

This is an automated email from the ASF dual-hosted git repository.

wesm pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/arrow.git


The following commit(s) were added to refs/heads/master by this push:
     new 12ed730  ARROW-5498: [C++][CI] Fix Flatbuffers related error with MinGW
12ed730 is described below

commit 12ed730a319c72abda4b645e0d6984253b9b9d43
Author: Sutou Kouhei <ko...@clear-code.com>
AuthorDate: Mon Jun 3 20:38:38 2019 -0500

    ARROW-5498: [C++][CI] Fix Flatbuffers related error with MinGW
    
    We should send a pull request that adds -DCMAKE_BUILD_TYPE=Release to
    https://github.com/msys2/MINGW-packages/blob/master/mingw-w64-flatbuffers/PKGBUILD
    .
    
    Author: Sutou Kouhei <ko...@clear-code.com>
    
    Closes #4465 from kou/cpp-appveyor-flatbuffers and squashes the following commits:
    
    76f49a6a6 <Sutou Kouhei>  Fix Flatbuffers related error with MinGW
---
 cpp/cmake_modules/ThirdpartyToolchain.cmake | 26 +++++++++++++++-----------
 1 file changed, 15 insertions(+), 11 deletions(-)

diff --git a/cpp/cmake_modules/ThirdpartyToolchain.cmake b/cpp/cmake_modules/ThirdpartyToolchain.cmake
index bc70912..5aade0d 100644
--- a/cpp/cmake_modules/ThirdpartyToolchain.cmake
+++ b/cpp/cmake_modules/ThirdpartyToolchain.cmake
@@ -1513,17 +1513,21 @@ if(ARROW_WITH_FLATBUFFERS)
                                      "${FLATBUFFERS_INCLUDE_DIR}")
   endif()
 
-  # mingw-w64-flatbuffers doesn't set the flatc target
-  if(NOT TARGET flatbuffers::flatc)
-    get_target_property(FLATBUFFERS_INCLUDE_DIR flatbuffers::flatbuffers
-                        INTERFACE_INCLUDE_DIRECTORIES)
-    get_filename_component(FB_ROOT "${FLATBUFFERS_INCLUDE_DIR}" DIRECTORY)
-    find_program(FLATBUFFERS_COMPILER
-                 NAMES flatc flatc.exe PATH ${FB_ROOT}
-                 PATH_SUFFIXES "bin")
-    add_executable(flatbuffers::flatc IMPORTED)
-    set_target_properties(flatbuffers::flatc
-                          PROPERTIES IMPORTED_LOCATION "${FLATBUFFERS_COMPILER}")
+  if(TARGET flatbuffers::flatc)
+    get_target_property(FLATBUFFERS_COMPILER_LOCATION_CONFIG flatbuffers::flatc
+                        IMPORTED_LOCATION_${UPPERCASE_BUILD_TYPE})
+    get_target_property(FLATBUFFERS_COMPILER_LOCATION flatbuffers::flatc
+                        IMPORTED_LOCATION)
+    get_target_property(FLATBUFFERS_COMPILER_LOCATION_NOCONFIG flatbuffers::flatc
+                        IMPORTED_LOCATION_NOCONFIG)
+    # mingw-w64-flatbuffers provides location only for "noconfig"
+    if(NOT FLATBUFFERS_COMPILER_LOCATION_CONFIG
+       AND NOT FLATBUFFERS_COMPILER_LOCATION
+       AND FLATBUFFERS_COMPILER_LOCATION_NOCONFIG)
+      set_target_properties(flatbuffers::flatc
+                            PROPERTIES IMPORTED_LOCATION
+                                       "${FLATBUFFERS_COMPILER_LOCATION_NOCONFIG}")
+    endif()
   endif()
 
   # TODO: Don't use global includes but rather target_include_directories