Skip to content

Commit 511776f

Browse files
committed
update
1 parent 7c105d4 commit 511776f

File tree

2 files changed

+38
-4
lines changed

2 files changed

+38
-4
lines changed

cpp/src/parquet/CMakeLists.txt

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -206,10 +206,11 @@ if(DEFINED ARROW_FSST_INCLUDE_DIR)
206206
list(APPEND PARQUET_TEST_EXTRA_INCLUDES ${ARROW_FSST_INCLUDE_DIR})
207207
endif()
208208
if(DEFINED ARROW_FSST_SOURCES)
209-
set_source_files_properties(${ARROW_FSST_SOURCES}
210-
PROPERTIES
211-
COMPILE_OPTIONS
212-
"$<$<COMPILE_LANG_AND_ID:CXX,Clang,AppleClang>:-Wno-error=shorten-64-to-32>")
209+
set_property(SOURCE ${ARROW_FSST_SOURCES} APPEND PROPERTY COMPILE_OPTIONS
210+
"$<$<OR:$<CXX_COMPILER_ID:Clang>,$<CXX_COMPILER_ID:AppleClang>>:-Wno-error=shorten-64-to-32;-Wno-shorten-64-to-32>"
211+
"$<$<OR:$<CXX_COMPILER_ID:Clang>,$<CXX_COMPILER_ID:AppleClang>,$<CXX_COMPILER_ID:GNU>>:-Wno-error=missing-declarations;-Wno-missing-declarations>"
212+
"$<$<CXX_COMPILER_ID:MSVC>:/wd4244>"
213+
"$<$<AND:$<PLATFORM_ID:Windows>,$<NOT:$<CXX_COMPILER_ID:MSVC>>>:-include${CMAKE_CURRENT_SOURCE_DIR}/fsst_compat.h>")
213214
endif()
214215

215216
if(ARROW_HAVE_RUNTIME_AVX2)

cpp/src/parquet/fsst_compat.h

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
// Licensed to the Apache Software Foundation (ASF) under one
2+
// or more contributor license agreements. See the NOTICE file
3+
// distributed with this work for additional information
4+
// regarding copyright ownership. The ASF licenses this file
5+
// to you under the Apache License, Version 2.0 (the
6+
// "License"); you may not use this file except in compliance
7+
// with the License. You may obtain a copy of the License at
8+
//
9+
// http://www.apache.org/licenses/LICENSE-2.0
10+
//
11+
// Unless required by applicable law or agreed to in writing,
12+
// software distributed under the License is distributed on an
13+
// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
14+
// KIND, either express or implied. See the License for the
15+
// specific language governing permissions and limitations
16+
// under the License.
17+
18+
#pragma once
19+
20+
// Provide minimal compatibility shims so third-party FSST sources
21+
// can be compiled with the compilers Arrow supports.
22+
23+
#if defined(_WIN32) && !defined(_MSC_VER)
24+
#include <cpuid.h>
25+
26+
// MinGW does not provide __cpuidex, but FSST only needs the CPUID
27+
// leaf/sub-leaf variant that __cpuid_count implements.
28+
static inline void arrow_fsst_cpuidex(int info[4], int function_id, int subfunction_id) {
29+
__cpuid_count(function_id, subfunction_id, info[0], info[1], info[2], info[3]);
30+
}
31+
#define __cpuidex(info, function_id, subfunction_id) \
32+
arrow_fsst_cpuidex(info, function_id, subfunction_id)
33+
#endif

0 commit comments

Comments
 (0)