forked from electronicarts/EASTL
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
17 changed files
with
546 additions
and
17 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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -47,3 +47,6 @@ Testing/* | |
/buckaroo/ | ||
.buckconfig.local | ||
BUCKAROO_DEPS | ||
|
||
# Bazel | ||
bazel-* |
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,105 @@ | ||
licenses(["notice"]) | ||
|
||
exports_files(["LICENSE"]) | ||
|
||
load( | ||
"//config:copts.bzl", | ||
"EASTL_DEFAULT_COPTS", | ||
"EASTL_TEST_COPTS", | ||
"EASTL_EXCEPTIONS_FLAG", | ||
"EASTL_EXCEPTIONS_FLAG_LINKOPTS", | ||
) | ||
|
||
cc_library( | ||
name = "eastl", | ||
srcs = glob([ | ||
"source/**/*.cpp", | ||
]), | ||
hdrs = glob([ | ||
"include/EASTL/**/*.h", | ||
]), | ||
copts = EASTL_DEFAULT_COPTS + [ | ||
"-D_CHAR16T", | ||
"-D_CRT_SECURE_NO_WARNINGS", | ||
"-D_SCL_SECURE_NO_WARNINGS", | ||
"-DEASTL_OPENSOURCE=1", | ||
], | ||
linkopts = EASTL_EXCEPTIONS_FLAG_LINKOPTS, | ||
strip_include_prefix = "include", | ||
visibility = [ | ||
"//visibility:public", | ||
], | ||
deps = [ | ||
"//test/packages/EABase:eabase", | ||
], | ||
) | ||
|
||
cc_library( | ||
name = "test", | ||
srcs = glob( | ||
[ | ||
"test/source/**/*.cpp", | ||
"test/source/**/*.h", | ||
], | ||
exclude = [ | ||
"test/source/main.cpp", | ||
], | ||
), | ||
hdrs = glob( | ||
[ | ||
"test/source/**/*.h", | ||
], | ||
), | ||
copts = EASTL_TEST_COPTS + [ | ||
"-DEASTL_OPENSOURCE=1", | ||
"-DEASTL_THREAD_SUPPORT_AVAILABLE=0", | ||
], | ||
linkopts = EASTL_EXCEPTIONS_FLAG_LINKOPTS, | ||
strip_include_prefix = "test/source", | ||
textual_hdrs = glob([ | ||
"test/source/**/*.inl", | ||
]), | ||
deps = [ | ||
"//:eastl", | ||
"//test/packages/EAAssert:eaassert", | ||
"//test/packages/EABase:eabase", | ||
"//test/packages/EAMain:eamain", | ||
"//test/packages/EAStdC:eastdc", | ||
"//test/packages/EATest:eatest", | ||
"//test/packages/EAThread:eathread", | ||
], | ||
) | ||
|
||
cc_binary( | ||
name = "test-runner", | ||
srcs = glob([ | ||
"test/source/main.cpp", | ||
]), | ||
copts = EASTL_DEFAULT_COPTS + [ | ||
"-DEASTL_OPENSOURCE=1", | ||
"-DEASTL_THREAD_SUPPORT_AVAILABLE=0", | ||
], | ||
linkopts = EASTL_EXCEPTIONS_FLAG_LINKOPTS, | ||
deps = [ | ||
"//:test", | ||
], | ||
) | ||
|
||
cc_binary( | ||
name = "benchmark", | ||
srcs = glob([ | ||
"benchmark/source/**/*.cpp", | ||
"benchmark/source/**/*.h", | ||
]), | ||
copts = EASTL_DEFAULT_COPTS + [ | ||
"-DEASTL_OPENSOURCE=1", | ||
"-DEASTL_THREAD_SUPPORT_AVAILABLE=0", | ||
], | ||
linkopts = EASTL_EXCEPTIONS_FLAG_LINKOPTS, | ||
deps = [ | ||
"//:eastl", | ||
"//:test", | ||
"//test/packages/EAStdC:eastdc", | ||
"//test/packages/EATest:eatest", | ||
], | ||
) |
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,12 @@ | ||
workspace(name = "com_ea_eastl") | ||
|
||
# Bazel toolchains | ||
http_archive( | ||
name = "bazel_toolchains", | ||
sha256 = "4329663fe6c523425ad4d3c989a8ac026b04e1acedeceb56aa4b190fa7f3973c", | ||
strip_prefix = "bazel-toolchains-bc09b995c137df042bb80a395b73d7ce6f26afbe", | ||
urls = [ | ||
"https://mirror.bazel.build/github.com/bazelbuild/bazel-toolchains/archive/bc09b995c137df042bb80a395b73d7ce6f26afbe.tar.gz", | ||
"https://github.com/bazelbuild/bazel-toolchains/archive/bc09b995c137df042bb80a395b73d7ce6f26afbe.tar.gz", | ||
], | ||
) |
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,33 @@ | ||
load(":compiler_config_setting.bzl", "create_llvm_config") | ||
|
||
create_llvm_config( | ||
name = "llvm_compiler", | ||
visibility = ["//:__subpackages__"], | ||
) | ||
|
||
# following configs are based on mapping defined in: https://git.io/v5Ijz | ||
config_setting( | ||
name = "ios", | ||
values = { | ||
"cpu": "darwin", | ||
}, | ||
visibility = ["//:__subpackages__"], | ||
) | ||
|
||
config_setting( | ||
name = "windows", | ||
values = { | ||
"cpu": "x64_windows", | ||
}, | ||
visibility = ["//:__subpackages__"], | ||
) | ||
|
||
config_setting( | ||
name = "ppc", | ||
values = { | ||
"cpu": "ppc", | ||
}, | ||
visibility = ["//:__subpackages__"], | ||
) | ||
|
||
|
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,39 @@ | ||
# | ||
# Copyright 2018 The Abseil Authors. | ||
# | ||
# Licensed 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. | ||
# | ||
|
||
"""Creates config_setting that allows selecting based on 'compiler' value.""" | ||
|
||
def create_llvm_config(name, visibility): | ||
# The "do_not_use_tools_cpp_compiler_present" attribute exists to | ||
# distinguish between older versions of Bazel that do not support | ||
# "@bazel_tools//tools/cpp:compiler" flag_value, and newer ones that do. | ||
# In the future, the only way to select on the compiler will be through | ||
# flag_values{"@bazel_tools//tools/cpp:compiler"} and the else branch can | ||
# be removed. | ||
if hasattr(cc_common, "do_not_use_tools_cpp_compiler_present"): | ||
native.config_setting( | ||
name = name, | ||
flag_values = { | ||
"@bazel_tools//tools/cpp:compiler": "llvm", | ||
}, | ||
visibility = visibility, | ||
) | ||
else: | ||
native.config_setting( | ||
name = name, | ||
values = {"compiler": "llvm"}, | ||
visibility = visibility, | ||
) |
Oops, something went wrong.