@@ -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+
7892TIFF_PUBLIC_HEADERS = [
7993 "libtiff/tiff.h" ,
8094 "libtiff/tiffio.h" ,
81- "libtiff/tiffvers.h" ,
8295 ":tiffconf_h" ,
96+ ":tiffvers_h" ,
8397]
8498
8599TIFF_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.
177187cc_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)
0 commit comments