Skip to content

Commit

Permalink
ARROW-12589: [C++] Compiling on windows doesn't work when -DARROW_WIT…
Browse files Browse the repository at this point in the history
…H_BACKTRACE=OFF

    [4/116] Building CXX object src/arrow/CMakeFiles/arrow_shared.dir/Unity/unity_17_cxx.cxx.obj
    FAILED: src/arrow/CMakeFiles/arrow_shared.dir/Unity/unity_17_cxx.cxx.obj
    C:/msys64/mingw64/bin/ccache.exe C:\msys64\mingw64\bin\c++.exe ...
    In file included from src/arrow/CMakeFiles/arrow_shared.dir/Unity/unity_17_cxx.cxx:3:
    C:/msys64/home/javan/arrow/arrow-master/cpp/src/arrow/filesystem/filesystem.cc:81:28: error: function 'std::ostream& arrow::fs::operator<<(std::ostream&, arrow::fs::FileType)' definition is marked dllimport
    81 | ARROW_EXPORT std::ostream& operator<<(std::ostream& os, FileType ftype) {
    |                            ^~~~~~~~
    [5/116] Building CXX object src/arrow/CMakeFiles/arrow_shared.dir/Unity/unity_2_cxx.cxx.obj

Closes apache#10188 from amol-/ARROW-12589

Authored-by: Alessandro Molina <[email protected]>
Signed-off-by: Sutou Kouhei <[email protected]>
  • Loading branch information
amol- authored and kou committed Apr 29, 2021
1 parent 0a3cbd0 commit 33ef1d6
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion cpp/src/arrow/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -515,11 +515,14 @@ if(ARROW_BUILD_STATIC AND WIN32)
target_compile_definitions(arrow_static PUBLIC ARROW_STATIC)
endif()

foreach(LIB_TARGET ${ARROW_LIBRARIES})
target_compile_definitions(${LIB_TARGET} PRIVATE ARROW_EXPORTING)
endforeach()

if(ARROW_WITH_BACKTRACE)
find_package(Backtrace)

foreach(LIB_TARGET ${ARROW_LIBRARIES})
target_compile_definitions(${LIB_TARGET} PRIVATE ARROW_EXPORTING)
if(Backtrace_FOUND AND ARROW_WITH_BACKTRACE)
target_compile_definitions(${LIB_TARGET} PRIVATE ARROW_WITH_BACKTRACE)
endif()
Expand Down

0 comments on commit 33ef1d6

Please sign in to comment.