Skip to content

Commit 8d23bd2

Browse files
committed
Test another more clean tiff bazelization
1 parent 4d089bf commit 8d23bd2

File tree

4 files changed

+17
-65
lines changed

4 files changed

+17
-65
lines changed

third_party/tiff-4.7.1/BUILD.bazel

Lines changed: 16 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -75,11 +75,25 @@ cmake_configure_file(
7575
],
7676
)
7777

78+
cmake_configure_file(
79+
name = "tiffvers_h",
80+
src = "libtiff/tiffvers.h.cmake.in",
81+
out = "libtiff/tiffvers.h",
82+
defines = [
83+
"LIBTIFF_VERSION=4.7.1",
84+
"LIBTIFF_RELEASE_DATE=20250911",
85+
"LIBTIFF_MAJOR_VERSION=4",
86+
"LIBTIFF_MINOR_VERSION=7",
87+
"LIBTIFF_MICRO_VERSION=1",
88+
"VAR=", # Appears in a comment, but cmake_configure_file requires it
89+
],
90+
)
91+
7892
TIFF_PUBLIC_HEADERS = [
7993
"libtiff/tiff.h",
8094
"libtiff/tiffio.h",
81-
"libtiff/tiffvers.h",
8295
":tiffconf_h",
96+
":tiffvers_h",
8397
]
8498

8599
TIFF_PRIVATE_HEADERS = [
@@ -170,26 +184,12 @@ cc_library(
170184
)
171185

172186
# Public library - exposes headers to users
173-
# Note: The VERSION file has been modified to be valid C++ to prevent conflicts
174-
# with C++20's <version> header on Windows (case-insensitive filesystem)
175-
# On Windows, when C++20 code includes <version>, the case-insensitive filesystem
176-
# may match VERSION instead. We expose this file so Bazel can track the dependency.
177187
cc_library(
178188
name = "tiff",
179-
hdrs = TIFF_PUBLIC_HEADERS + [
180-
# VERSION file is now valid C++ to prevent collision with <version> on Windows
181-
# Added to hdrs (not textual_hdrs) so Bazel properly tracks it as a dependency
182-
"VERSION",
183-
] + select({
184-
# On Windows (case-insensitive filesystem), Bazel tracks the include as lowercase
185-
# 'version' even though the file is 'VERSION'. We add it so Bazel can find it.
186-
"@platforms//os:windows": ["version"],
187-
"//conditions:default": [],
188-
}),
189+
hdrs = TIFF_PUBLIC_HEADERS,
189190
implementation_deps = [":tiff_impl"],
190191
includes = [
191192
"libtiff",
192-
"", # Include root to allow VERSION to be found when matched as <version>
193193
],
194194
visibility = ["//visibility:public"],
195195
)

third_party/tiff-4.7.1/MODULE.bazel

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ module(
55
#bazel_compatibility = [">=7.2.1"],
66
)
77

8-
bazel_dep(name = "cmake_configure_file", version = "0.1.4")
8+
bazel_dep(name = "cmake_configure_file", version = "0.1.5")
99
bazel_dep(name = "rules_cc", version = "0.2.16")
1010
bazel_dep(name = "platforms", version = "1.0.0")
1111
bazel_dep(name = "zlib", version = "1.3.1.bcr.8")

third_party/tiff-4.7.1/VERSION

Lines changed: 0 additions & 12 deletions
This file was deleted.

third_party/tiff-4.7.1/libtiff/tiffvers.h

Lines changed: 0 additions & 36 deletions
This file was deleted.

0 commit comments

Comments
 (0)