Skip to content

Commit

Permalink
Fix LLVM 7 issues with MSVC, enable FindClangTools.cmake to find clan…
Browse files Browse the repository at this point in the history
…g-format in conda env
  • Loading branch information
wesm committed Feb 8, 2019
1 parent 3677115 commit 8ae63f1
Show file tree
Hide file tree
Showing 3 changed files with 19 additions and 6 deletions.
6 changes: 4 additions & 2 deletions cpp/cmake_modules/FindClangTools.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -53,8 +53,10 @@ set(CLANG_TOOLS_SEARCH_PATHS
${ClangTools_PATH}
$ENV{CLANG_TOOLS_PATH}
/usr/local/bin /usr/bin
"C:/Program Files/LLVM/bin"
"${HOMEBREW_PREFIX}/bin")
"C:/Program Files/LLVM/bin" # Windows, non-conda
"$ENV{CONDA_PREFIX}/Library/bin" # Windows, conda
"${HOMEBREW_PREFIX}/bin"
)

find_program(CLANG_TIDY_BIN
NAMES clang-tidy-${ARROW_LLVM_VERSION}
Expand Down
6 changes: 6 additions & 0 deletions cpp/src/gandiva/engine.cc
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,12 @@
// specific language governing permissions and limitations
// under the License.

// TODO(wesm): LLVM 7 produces pesky C4244 that disable pragmas around the LLVM
// includes seem to not fix as with LLVM 6
#if defined(_MSC_VER)
#pragma warning(disable : 4244)
#endif

#include "gandiva/engine.h"

#include <iostream>
Expand Down
13 changes: 9 additions & 4 deletions cpp/src/gandiva/precompiled/time_test.cc
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,15 @@ TEST(TestTime, TestCastTimestamp) {
-1187308799080);
EXPECT_EQ(castTIMESTAMP_utf8(context_ptr, "1857-02-11 20:31:40.920 -05:30", 30),
-3562264699080);
}

#ifndef _WIN32

// TODO(wesm): ARROW-4495. Need to address TZ database issues on Windows

TEST(TestTime, TestCastTimestampWithTZ) {
ExecutionContext context;
int64_t context_ptr = reinterpret_cast<int64_t>(&context);

EXPECT_EQ(castTIMESTAMP_utf8(context_ptr, "2000-09-23 9:45:30.920 Canada/Pacific", 37),
969727530920);
Expand All @@ -76,10 +85,6 @@ TEST(TestTime, TestCastTimestamp) {
-1459094217000);
}

#ifndef _WIN32

// TODO(wesm): ARROW-4495. Fix these tests on Windows

TEST(TestTime, TestCastTimestampErrors) {
ExecutionContext context;
int64_t context_ptr = reinterpret_cast<int64_t>(&context);
Expand Down

0 comments on commit 8ae63f1

Please sign in to comment.