Skip to content

Commit

Permalink
Project import generated by Copybara.
Browse files Browse the repository at this point in the history
GitOrigin-RevId: cfbd06bf229c1d4137f7c5f31c4ef978044546ab
  • Loading branch information
Vertexwahn committed Oct 18, 2024
1 parent 8307765 commit ee5eead
Show file tree
Hide file tree
Showing 17 changed files with 271 additions and 28 deletions.
7 changes: 7 additions & 0 deletions devertexwahn/.bazelrc
Original file line number Diff line number Diff line change
Expand Up @@ -83,6 +83,13 @@ build:gcc11_cpp14 --cxxopt=-std=c++14
build:gcc11_cpp14 --cxxopt=-Wall
build:gc11_cpp14 --define compiler=gcc11_cpp14

# GCC 13
build:gcc13 --cxxopt=-std=c++20
build:gcc13 --cxxopt=-Wall
build:gcc13 --define compiler=gcc13
build:gcc13 --cxxopt=-fpermissive # Needed for fmt
build:gcc13 --noincompatible_enable_cc_toolchain_resolution # disable LLVM toolchain

# Clang 14.0.0 (config is used on Ubuntu)
build:clang14 --cxxopt=-std=c++20
#build:clang14 --cxxopt=-mavx
Expand Down
27 changes: 16 additions & 11 deletions devertexwahn/MODULE.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -12,20 +12,19 @@ module(

bazel_dep(name = "abseil-cpp", version = "20240722.0")
bazel_dep(name = "apple_support", version = "1.16.0")
bazel_dep(name = "aspect_rules_lint", version = "1.0.0-rc6")
bazel_dep(name = "bazel_skylib", version = "1.7.1")
bazel_dep(name = "boost.algorithm", version = "1.83.0.bcr.1")
bazel_dep(name = "boost.asio", version = "1.83.0.bcr.1")
bazel_dep(name = "boost.core", version = "1.83.0.bcr.1")
bazel_dep(name = "boost.predef", version = "1.83.0.bcr.1")
bazel_dep(name = "boost.program_options", version = "1.83.0.bcr.1")
bazel_dep(name = "boost.uuid", version = "1.83.0.bcr.1")
bazel_dep(name = "eigen", version = "3.4.0")
bazel_dep(name = "eigen", version = "3.4.0.bcr.1")
bazel_dep(name = "fmt", version = "11.0.2")
bazel_dep(name = "gazelle", version = "0.38.0")
bazel_dep(name = "hypothesis")
bazel_dep(name = "imath", version = "3.1.11.bcr.1")
bazel_dep(name = "libdeflate", version = "1.21")
bazel_dep(name = "imath", version = "3.1.12")
bazel_dep(name = "libdeflate", version = "1.22")
bazel_dep(name = "libjpeg_turbo", version = "2.1.4")
bazel_dep(name = "libpng", version = "1.6.43")
bazel_dep(name = "libwebp", version = "1.4.0")
Expand All @@ -45,9 +44,10 @@ bazel_dep(name = "xtl")
bazel_dep(name = "yaml-cpp", version = "0.8.0")
bazel_dep(name = "zlib", version = "1.3.1.bcr.3")

bazel_dep(name = "aspect_rules_lint", version = "1.0.2", dev_dependency = True)
bazel_dep(name = "catch2", version = "3.5.4", dev_dependency = True)
bazel_dep(name = "google_benchmark", version = "1.8.5", dev_dependency = True)
bazel_dep(name = "googletest", version = "1.15.0", dev_dependency = True)
bazel_dep(name = "googletest", version = "1.15.2", dev_dependency = True)

# This projects intends to stay as close as possible to upstream dependencies (Live at Head). Therefore, upstream
# dependencies are copied on a regular basis 1:1 with some Bazel related patches (if needed) to the `third_party` folder
Expand All @@ -67,10 +67,15 @@ local_path_override(
)

local_path_override(
module_name = "fmt",
path = "../third_party/fmt",
module_name = "catch2",
path = "../third_party/Catch2",
)

#local_path_override(
# module_name = "fmt",
# path = "../third_party/fmt",
#)

local_path_override(
module_name = "imath",
path = "../third_party/Imath",
Expand Down Expand Up @@ -112,13 +117,13 @@ local_path_override(
)

local_path_override(
module_name = "yaml-cpp",
path = "../third_party/yaml-cpp",
module_name = "spdlog",
path = "../third_party/spdlog",
)

local_path_override(
module_name = "catch2",
path = "../third_party/Catch2",
module_name = "yaml-cpp",
path = "../third_party/yaml-cpp",
)

#-------------------------------------------------------------------------------------
Expand Down
10 changes: 5 additions & 5 deletions devertexwahn/ci/ubuntu-24.04-gcc13-fast-opt.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -39,27 +39,27 @@ steps:
- script: |
cd devertexwahn
bazel run --config=gcc11 -- //tools/compiler_information
bazel run --config=gcc13 -- //tools/compiler_information
displayName: "Show compiler information"
- script: |
cd devertexwahn
bazel build --config=gcc11 -- //...
bazel build --config=gcc13 -- //...
displayName: "Bazel build gcc11-fastbuild"
- script: |
cd devertexwahn
bazel test --config=gcc11 -- //...
bazel test --config=gcc13 -- //...
displayName: "Bazel test gcc11-fastbuild"
- script: |
cd devertexwahn
bazel build --config=gcc11 --compilation_mode=opt -- //...
bazel build --config=gcc13 --compilation_mode=opt -- //...
displayName: "Bazel build gcc11-opt"
- script: |
cd devertexwahn
bazel test --config=gcc11 --compilation_mode=opt -- //...
bazel test --config=gcc13 --compilation_mode=opt -- //...
displayName: "Bazel test gcc11-opt"
- script: |
Expand Down
13 changes: 13 additions & 0 deletions devertexwahn/core/platform.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
#include "core/namespace.hpp"

#include "boost/predef.h"
#include "boost/predef/other/endian.h"

#include <string_view>

Expand All @@ -25,6 +26,18 @@
#define DE_VERTEXWAHN_OS_LINUX
#endif

#if BOOST_ENDIAN_BIG_BYTE
#define DE_VERTEXWAHN_BIG_ENDIAN 1
#else
#define DE_VERTEXWAHN_BIG_ENDIAN 0
#endif

#if BOOST_ENDIAN_LITTLE_BYTE
#define DE_VERTEXWAHN_LITTLE_ENDIAN 1
#else
#define DE_VERTEXWAHN_LITTLE_ENDIAN 0
#endif

DE_VERTEXWAHN_BEGIN_NAMESPACE

[[nodiscard]] void *dynamic_module_find_symbol(void *handle, std::string_view name) noexcept;
Expand Down
2 changes: 2 additions & 0 deletions devertexwahn/imaging/io/io_test.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -161,6 +161,8 @@ TEST(Image, try_to_store_image4f_with_invalid_extension) {

TEST(Image, WhenTryToLoadNonExistingFile_ThenThrowException) {
EXPECT_THROW(load_image_asImage4f("non_existing_file.png"), std::runtime_error);
EXPECT_THROW(load_image_asImage4f("non_existing_file.bmp"), std::runtime_error);
EXPECT_THROW(load_image_asImage3b("non_existing_file.gif"), std::runtime_error);
}

TEST(Image, load_image_asImage4f) {
Expand Down
34 changes: 34 additions & 0 deletions renovate.json5
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
{
"extends": [
"config:base"
],
"ignorePaths": [
".buildkite",
".github",
"archive",
"assets",
"bazel_demos",
"build_tools",
"dvpe",
"infrastructure",
"literature",
"mirror",
"modernizer",
"motivation",
"photos",
"resume",
"third_party",
"wiki",
"zero_ray"
],
"regexManagers": [
{
"fileMatch": "\\.bazelversion",
"matchStrings": [
"(?<currentValue>[0-9]+.[0-9]+.[0-9]+)"
],
"depNameTemplate": "bazelbuild/bazel",
"datasourceTemplate": "github-releases"
}
]
}
6 changes: 4 additions & 2 deletions third_party/fmt/.github/workflows/cifuzz.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,18 +10,20 @@ jobs:
steps:
- name: Build fuzzers
id: build
uses: google/oss-fuzz/infra/cifuzz/actions/build_fuzzers@92182553173581f871130c71c71b17f003d47b0a # master
uses: google/oss-fuzz/infra/cifuzz/actions/build_fuzzers@9218255
with:
oss-fuzz-project-name: 'fmt'
dry-run: false
language: c++

- name: Run fuzzers
uses: google/oss-fuzz/infra/cifuzz/actions/run_fuzzers@92182553173581f871130c71c71b17f003d47b0a # master
uses: google/oss-fuzz/infra/cifuzz/actions/run_fuzzers@9218255
with:
oss-fuzz-project-name: 'fmt'
fuzz-seconds: 300
dry-run: false
language: c++

- name: Upload crash
uses: actions/upload-artifact@50769540e7f4bd5e21e526ee35c689e35e0d6874 # v4.4.0
if: failure() && steps.build.outcome == 'success'
Expand Down
10 changes: 6 additions & 4 deletions third_party/fmt/.github/workflows/lint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,11 +16,13 @@ jobs:
- uses: actions/checkout@d632683dd7b4114ad314bca15554477dd762a938 # v4.2.0

- name: Install clang-format
uses: aminya/setup-cpp@290824452986e378826155f3379d31bce8753d76 # v0.37.0
with:
clangformat: 17.0.5
run: |
wget https://apt.llvm.org/llvm.sh
sudo bash ./llvm.sh 17
sudo apt install clang-format-17
- name: Run clang-format
run: |
find include src -name '*.h' -o -name '*.cc' | xargs clang-format -i -style=file -fallback-style=none
find include src -name '*.h' -o -name '*.cc' | \
xargs clang-format-17 -i -style=file -fallback-style=none
git diff --exit-code
2 changes: 1 addition & 1 deletion third_party/openexr/.bazelversion
Original file line number Diff line number Diff line change
@@ -1 +1 @@
7.3.1
7.3.2
22 changes: 21 additions & 1 deletion third_party/openexr/MODULE.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,26 @@ module(
)

bazel_dep(name = "bazel_skylib", version = "1.7.1")
bazel_dep(name = "imath", version = "3.1.12")
bazel_dep(name = "imath")
bazel_dep(name = "libdeflate", version = "1.21")
bazel_dep(name = "platforms", version = "0.0.10")

archive_override(
module_name = "imath",
patches = [
"//bazel:imath_add_build_file.patch",
"//bazel:imath_module_dot_bazel.patch",
],
strip_prefix = "Imath-main",
urls = ["https://github.com/AcademySoftwareFoundation/Imath/archive/refs/heads/main.zip"],
)

archive_override(
module_name = "libdeflate",
patches = [
"//bazel:libdeflate_add_build_file.patch",
"//bazel:libdeflate_module_dot_bazel.patch",
],
strip_prefix = "libdeflate-master",
urls = ["https://github.com/ebiggers/libdeflate/archive/refs/heads/master.zip"],
)
1 change: 1 addition & 0 deletions third_party/openexr/bazel/BUILD.bazel
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
# Empty by intend
86 changes: 86 additions & 0 deletions third_party/openexr/bazel/imath_add_build_file.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,86 @@
--- /dev/null
+++ BUILD.bazel
@@ -0,0 +1,83 @@
+# SPDX-License-Identifier: BSD-3-Clause
+# Copyright (c) Contributors to the OpenEXR Project.
+
+load("@bazel_skylib//rules:expand_template.bzl", "expand_template")
+
+expand_template(
+ name = "ImathConfig",
+ out = "src/Imath/ImathConfig.h",
+ substitutions = {
+ "@IMATH_INTERNAL_NAMESPACE@": "Imath_3_1",
+ "@IMATH_LIB_VERSION@": "3.1.12",
+ "@IMATH_NAMESPACE_CUSTOM@": "0",
+ "@IMATH_NAMESPACE@": "Imath",
+ "@IMATH_PACKAGE_NAME@": "Imath 3.1.12",
+ "@Imath_VERSION_MAJOR@": "3",
+ "@Imath_VERSION_MINOR@": "1",
+ "@Imath_VERSION_PATCH@": "12",
+ "@IMATH_VERSION@": "3.1.12",
+ "#cmakedefine IMATH_HALF_USE_LOOKUP_TABLE": "#define IMATH_HALF_USE_LOOKUP_TABLE",
+ "#cmakedefine IMATH_ENABLE_API_VISIBILITY": "#define IMATH_ENABLE_API_VISIBILITY",
+ "#cmakedefine IMATH_HAVE_LARGE_STACK": "/* #undef IMATH_HAVE_LARGE_STACK */",
+ "#cmakedefine01 IMATH_USE_NOEXCEPT": "#define IMATH_USE_NOEXCEPT 1",
+ },
+ template = "config/ImathConfig.h.in",
+ visibility = ["//visibility:public"],
+)
+
+cc_library(
+ name = "Imath",
+ srcs = [
+ "src/Imath/ImathColorAlgo.cpp",
+ "src/Imath/ImathFun.cpp",
+ "src/Imath/ImathMatrixAlgo.cpp",
+ "src/Imath/ImathRandom.cpp",
+ "src/Imath/half.cpp",
+ "src/Imath/toFloat.h",
+ ],
+ hdrs = [
+ "src/Imath/ImathBox.h",
+ "src/Imath/ImathBoxAlgo.h",
+ "src/Imath/ImathColor.h",
+ "src/Imath/ImathColorAlgo.h",
+ "src/Imath/ImathConfig.h",
+ "src/Imath/ImathEuler.h",
+ "src/Imath/ImathExport.h",
+ "src/Imath/ImathForward.h",
+ "src/Imath/ImathFrame.h",
+ "src/Imath/ImathFrustum.h",
+ "src/Imath/ImathFrustumTest.h",
+ "src/Imath/ImathFun.h",
+ "src/Imath/ImathGL.h",
+ "src/Imath/ImathGLU.h",
+ "src/Imath/ImathInt64.h",
+ "src/Imath/ImathInterval.h",
+ "src/Imath/ImathLine.h",
+ "src/Imath/ImathLineAlgo.h",
+ "src/Imath/ImathMath.h",
+ "src/Imath/ImathMatrix.h",
+ "src/Imath/ImathMatrixAlgo.h",
+ "src/Imath/ImathNamespace.h",
+ "src/Imath/ImathPlane.h",
+ "src/Imath/ImathPlatform.h",
+ "src/Imath/ImathQuat.h",
+ "src/Imath/ImathRandom.h",
+ "src/Imath/ImathRoots.h",
+ "src/Imath/ImathShear.h",
+ "src/Imath/ImathSphere.h",
+ "src/Imath/ImathTypeTraits.h",
+ "src/Imath/ImathVec.h",
+ "src/Imath/ImathVecAlgo.h",
+ "src/Imath/half.h",
+ "src/Imath/halfFunction.h",
+ "src/Imath/halfLimits.h",
+ ],
+ includes = ["src/Imath"],
+ visibility = ["//visibility:public"],
+)
+
+alias(
+ name = "imath",
+ actual = ":Imath",
+ visibility = ["//visibility:public"],
+)
9 changes: 9 additions & 0 deletions third_party/openexr/bazel/imath_module_dot_bazel.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
--- MODULE.bazel
+++ MODULE.bazel
@@ -0,0 +1,6 @@
+module(
+ name = "imath",
+ compatibility_level = 1,
+)
+
+bazel_dep(name = "bazel_skylib", version = "1.7.1")
Loading

0 comments on commit ee5eead

Please sign in to comment.