From db4e4ec0b8bea901cc7bfc25632bfa64fd160d9b Mon Sep 17 00:00:00 2001 From: Vertexwahn Date: Wed, 2 Oct 2024 19:24:40 +0200 Subject: [PATCH] Bazel support: Switch to Imath 3.1.12 (#1856) Signed-off-by: Vertexwahn --- .bazelrc | 12 +++++++ .bazelversion | 2 +- BUILD.bazel | 86 +++++---------------------------------------------- MODULE.bazel | 4 +-- 4 files changed, 23 insertions(+), 81 deletions(-) create mode 100644 .bazelrc diff --git a/.bazelrc b/.bazelrc new file mode 100644 index 0000000000..ed2cc48211 --- /dev/null +++ b/.bazelrc @@ -0,0 +1,12 @@ +# SPDX-License-Identifier: BSD-3-Clause +# Copyright (c) Contributors to the OpenEXR Project. + +common --enable_platform_specific_config + +# Enable modern C++ features +build:linux --cxxopt=-std=c++17 +build:linux --host_cxxopt=-std=c++17 +build:macos --cxxopt=-std=c++17 +build:macos --host_cxxopt=-std=c++17 +build:windows --cxxopt=/std:c++17 +build:windows --host_cxxopt=/std:c++17 diff --git a/.bazelversion b/.bazelversion index 21c8c7b46b..643916c03f 100644 --- a/.bazelversion +++ b/.bazelversion @@ -1 +1 @@ -7.1.1 +7.3.1 diff --git a/BUILD.bazel b/BUILD.bazel index 088646b226..fc9fd64745 100644 --- a/BUILD.bazel +++ b/BUILD.bazel @@ -12,7 +12,7 @@ expand_template( name = "IexConfig", out = "src/lib/Iex/IexConfig.h", substitutions = { - "@IEX_INTERNAL_NAMESPACE@": "Iex_3_2", + "@IEX_INTERNAL_NAMESPACE@": "Iex_3_3", "@IEX_NAMESPACE_CUSTOM@": "0", "@IEX_NAMESPACE@": "Iex", }, @@ -34,7 +34,7 @@ expand_template( name = "IlmThreadConfig", out = "src/lib/IlmThread/IlmThreadConfig.h", substitutions = { - "@ILMTHREAD_INTERNAL_NAMESPACE@": "IlmThread_3_2", + "@ILMTHREAD_INTERNAL_NAMESPACE@": "IlmThread_3_3", "@ILMTHREAD_NAMESPACE_CUSTOM@": "0", "@ILMTHREAD_NAMESPACE@": "IlmThread", "#cmakedefine01 ILMTHREAD_HAVE_POSIX_SEMAPHORES": "#define ILMTHREAD_HAVE_POSIX_SEMAPHORES 0", @@ -48,14 +48,14 @@ expand_template( out = "src/lib/OpenEXR/OpenEXRConfig.h", substitutions = { "@OPENEXR_IMF_NAMESPACE@": "Imf", - "@OPENEXR_INTERNAL_IMF_NAMESPACE@": "Imf_3_2", - "@OPENEXR_LIB_VERSION@": "3.2.0", - "@OPENEXR_NAMESPACE_CUSTOM@": "3.2.0", - "@OPENEXR_PACKAGE_NAME@": "OpenEXR 3.2.0", + "@OPENEXR_INTERNAL_IMF_NAMESPACE@": "Imf_3_3", + "@OPENEXR_LIB_VERSION@": "3.3.0", + "@OPENEXR_NAMESPACE_CUSTOM@": "3.3.0", + "@OPENEXR_PACKAGE_NAME@": "OpenEXR 3.3.0", "@OPENEXR_VERSION_EXTRA@": "", - "@OPENEXR_VERSION@": "3.2.0", + "@OPENEXR_VERSION@": "3.3.0", "@OPENEXR_VERSION_MAJOR@": "3", - "@OPENEXR_VERSION_MINOR@": "2", + "@OPENEXR_VERSION_MINOR@": "3", "@OPENEXR_VERSION_PATCH@": "0", "#cmakedefine OPENEXR_ENABLE_API_VISIBILITY": "#define OPENEXR_ENABLE_API_VISIBILITY", "#cmakedefine OPENEXR_HAVE_LARGE_STACK 1": "/* #undef OPENEXR_HAVE_LARGE_STACK */", @@ -103,14 +103,6 @@ cc_library( "src/lib/Iex/IexThrowErrnoExc.h", "src/lib/OpenEXR/OpenEXRConfig.h", ], - copts = select({ - ":windows": [ - "/std:c++17", - ], - "//conditions:default": [ - "--std=c++17", - ], - }), features = select({ ":windows": ["windows_export_all_symbols"], "//conditions:default": [], @@ -146,14 +138,6 @@ cc_library( "src/lib/IlmThread/IlmThreadProcessGroup.h", "src/lib/IlmThread/IlmThreadSemaphore.h", ], - copts = select({ - ":windows": [ - "/std:c++17", - ], - "//conditions:default": [ - "--std=c++17", - ], - }), features = select({ ":windows": ["windows_export_all_symbols"], "//conditions:default": [], @@ -499,15 +483,6 @@ cc_library( "src/lib/OpenEXR/OpenEXRConfig.h", "src/lib/OpenEXR/OpenEXRConfigInternal.h", ], - copts = select({ - ":windows": [ - "/std:c++17", - ], - "//conditions:default": [ - "--std=c++17", - "-Wno-error", - ], - }), features = select({ ":windows": ["windows_export_all_symbols"], "//conditions:default": [], @@ -538,15 +513,6 @@ cc_test( "src/test/IexTest/testBaseExc.cpp", "src/test/IexTest/testBaseExc.h", ], - copts = select({ - ":windows": [ - "/std:c++17", - ], - "//conditions:default": [ - "--std=c++17", - "-Wno-error", - ], - }), includes = ["src/test/IexTest"], tags = ["manual"], # This test is not build and executed in the CI deps = [ @@ -557,15 +523,6 @@ cc_test( cc_binary( name = "exr2aces", srcs = ["src/bin/exr2aces/main.cpp"], - copts = select({ - ":windows": [ - "/std:c++17", - ], - "//conditions:default": [ - "--std=c++17", - "-Wno-error", - ], - }), deps = [ ":OpenEXR", ], @@ -574,15 +531,6 @@ cc_binary( cc_binary( name = "exrheader", srcs = ["src/bin/exrheader/main.cpp"], - copts = select({ - ":windows": [ - "/std:c++17", - ], - "//conditions:default": [ - "--std=c++17", - "-Wno-error", - ], - }), deps = [ ":OpenEXR", ], @@ -599,15 +547,6 @@ cc_binary( "src/bin/exrenvmap/readInputImage.cpp", "src/bin/exrenvmap/resizeImage.cpp", ] + glob(["src/bin/exrenvmap/*.h"]), - copts = select({ - ":windows": [ - "/std:c++17", - ], - "//conditions:default": [ - "--std=c++17", - "-Wno-error", - ], - }), includes = [ "src/bin/exrenvmap", ], @@ -619,15 +558,6 @@ cc_binary( cc_binary( name = "exrstdattr", srcs = ["src/bin/exrstdattr/main.cpp"], - copts = select({ - ":windows": [ - "/std:c++17", - ], - "//conditions:default": [ - "--std=c++17", - "-Wno-error", - ], - }), deps = [ ":OpenEXR", ], diff --git a/MODULE.bazel b/MODULE.bazel index 5a18951007..e37d97da84 100644 --- a/MODULE.bazel +++ b/MODULE.bazel @@ -6,7 +6,7 @@ module( compatibility_level = 1, ) -bazel_dep(name = "bazel_skylib", version = "1.6.1") -bazel_dep(name = "imath", version = "3.1.11") +bazel_dep(name = "bazel_skylib", version = "1.7.1") +bazel_dep(name = "imath", version = "3.1.12") bazel_dep(name = "libdeflate", version = "1.21") bazel_dep(name = "platforms", version = "0.0.10")