-
Notifications
You must be signed in to change notification settings - Fork 257
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(bazel): support building C++ libs on windows platform (#1873)
<!-- **Thanks for contributing to Fury.** **If this is your first time opening a PR on fury, you can refer to [CONTRIBUTING.md](https://github.com/apache/fury/blob/main/CONTRIBUTING.md).** Contribution Checklist - The **Apache Fury (incubating)** community has restrictions on the naming of pr titles. You can also find instructions in [CONTRIBUTING.md](https://github.com/apache/fury/blob/main/CONTRIBUTING.md). - Fury has a strong focus on performance. If the PR you submit will have an impact on performance, please benchmark it first and provide the benchmark result here. --> ## What does this PR do? Make bazel happy on `Windows OS`. 1. Rewrite a little codes in `row.cc`, then it could be compiled by MSVC ([VLA is not supported](https://devblogs.microsoft.com/cppblog/c11-and-c17-standard-support-arriving-in-msvc/)) 2. Add MSVC flag [`/Zc:preprocessor`](https://learn.microsoft.com/en-us/cpp/build/reference/zc-preprocessor?view=msvc-170) to enable C99/C11 3. Add MSVC flag [`/utf-8`](https://learn.microsoft.com/en-us/cpp/build/reference/utf-8-set-source-and-executable-character-sets-to-utf-8?view=msvc-170) to set source and execution character sets to UTF-8. 4. Load arrow(arrow_python) interface libraries `*.lib` to the linker 5. Add a new CI env `windows-2022` to build fury cpp libraries <!-- Describe the purpose of this PR. --> ## Related issues #798 <!-- Is there any related issue? Please attach here. - #xxxx0 - #xxxx1 - #xxxx2 --> ## Does this PR introduce any user-facing change? <!-- If any user-facing interface changes, please [open an issue](https://github.com/apache/fury/issues/new/choose) describing the need to do so and update the document if necessary. --> - [ ] Does this PR introduce any public API change? - [ ] Does this PR introduce any binary protocol compatibility change? ## Benchmark <!-- When the PR has an impact on performance (if you don't know whether the PR will have an impact on performance, you can submit the PR first, and if it will have impact on performance, the code reviewer will explain it), be sure to attach a benchmark data here. --> --------- Signed-off-by: Junduo Dong <andj4cn@gmail.com>
- Loading branch information
Showing
6 changed files
with
114 additions
and
20 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,62 @@ | ||
# Licensed to the Apache Software Foundation (ASF) under one | ||
# or more contributor license agreements. See the NOTICE file | ||
# distributed with this work for additional information | ||
# regarding copyright ownership. The ASF licenses this file | ||
# to you under the Apache License, Version 2.0 (the | ||
# "License"); you may not use this file except in compliance | ||
# with the License. You may obtain a copy of the License at | ||
# | ||
# http://www.apache.org/licenses/LICENSE-2.0 | ||
# | ||
# Unless required by applicable law or agreed to in writing, | ||
# software distributed under the License is distributed on an | ||
# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY | ||
# KIND, either express or implied. See the License for the | ||
# specific language governing permissions and limitations | ||
# under the License. | ||
|
||
package(default_visibility = ["//visibility:public"]) | ||
|
||
load("@rules_cc//cc:defs.bzl", "cc_library", "cc_import") | ||
|
||
cc_library( | ||
name = "arrow", | ||
hdrs = [":arrow_header_include"], | ||
includes = ["include"], | ||
deps = [":arrow_shared_library"], | ||
visibility = ["//visibility:public"], | ||
) | ||
|
||
cc_import( | ||
name = "arrow_shared_library", | ||
interface_library = ":libarrow_interface", | ||
shared_library = ":libarrow", | ||
visibility = ["//visibility:public"], | ||
) | ||
|
||
cc_import( | ||
name = "arrow_python_shared_library", | ||
interface_library = ":libarrow_python_interface", | ||
shared_library = ":libarrow_python", | ||
visibility = ["//visibility:public"], | ||
) | ||
|
||
cc_library( | ||
name = "arrow_header_lib", | ||
hdrs = [":arrow_header_include"], | ||
includes = ["include"], | ||
visibility = ["//visibility:public"], | ||
) | ||
|
||
cc_library( | ||
name="python_numpy_headers", | ||
hdrs=[":python_numpy_include"], | ||
includes=["python_numpy_include"], | ||
) | ||
|
||
%{ARROW_HEADER_GENRULE} | ||
%{ARROW_LIBRARY_GENRULE} | ||
%{ARROW_ITF_LIBRARY_GENRULE} | ||
%{ARROW_PYTHON_LIBRARY_GENRULE} | ||
%{ARROW_PYTHON_ITF_LIB_GENRULE} | ||
%{PYTHON_NUMPY_INCLUDE_GENRULE} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters