Skip to content

Commit a9eb0e4

Browse files
committed
Improve the Bazel build file
1 parent 866b325 commit a9eb0e4

13 files changed

+109
-34
lines changed

.gitignore

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
1-
# Copyright (c) Team CharLS.
1+
# SPDX-FileCopyrightText: © 2014 Team CharLS
22
# SPDX-License-Identifier: BSD-3-Clause
33

44
.vscode/
55
.vs/
66
.idea
77
build*/
8-
bazel-*/
8+
bazel-*
99
MODULE.bazel.lock
1010
cmake-build-debug/
1111
TestResults/

BUILD.bazel

+84
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,84 @@
1+
# SPDX-FileCopyrightText: © 2025 Team CharLS
2+
# SPDX-License-Identifier: BSD-3-Clause
3+
4+
cc_library(
5+
name = "charls",
6+
srcs = [
7+
"src/charls_jpegls_decoder.cpp",
8+
"src/charls_jpegls_encoder.cpp",
9+
"src/coding_parameters.hpp",
10+
"src/color_transform.hpp",
11+
"src/conditional_static_cast.hpp",
12+
"src/constants.hpp",
13+
"src/copy_from_line_buffer.hpp",
14+
"src/copy_to_line_buffer.hpp",
15+
"src/default_traits.hpp",
16+
"src/golomb_lut.cpp",
17+
"src/golomb_lut.hpp",
18+
"src/jpeg_marker_code.hpp",
19+
"src/jpeg_stream_reader.cpp",
20+
"src/jpeg_stream_reader.hpp",
21+
"src/jpeg_stream_writer.cpp",
22+
"src/jpeg_stream_writer.hpp",
23+
"src/jpegls_algorithm.hpp",
24+
"src/jpegls_error.cpp",
25+
"src/jpegls_preset_coding_parameters.hpp",
26+
"src/jpegls_preset_parameters_type.hpp",
27+
"src/lossless_traits.hpp",
28+
"src/make_scan_codec.cpp",
29+
"src/make_scan_codec.hpp",
30+
"src/pch.hpp",
31+
"src/quantization_lut.cpp",
32+
"src/quantization_lut.hpp",
33+
"src/regular_mode_context.hpp",
34+
"src/run_mode_context.hpp",
35+
"src/scan_codec.hpp",
36+
"src/scan_decoder.hpp",
37+
"src/scan_decoder_impl.hpp",
38+
"src/scan_encoder.hpp",
39+
"src/scan_encoder_impl.hpp",
40+
"src/span.hpp",
41+
"src/util.hpp",
42+
"src/validate_spiff_header.cpp",
43+
"src/version.cpp",
44+
],
45+
hdrs = [
46+
"include/charls/annotations.h",
47+
"include/charls/api_abi.h",
48+
"include/charls/charls.h",
49+
"include/charls/charls.hpp",
50+
"include/charls/charls_jpegls_decoder.h",
51+
"include/charls/charls_jpegls_encoder.h",
52+
"include/charls/jpegls_decoder.hpp",
53+
"include/charls/jpegls_encoder.hpp",
54+
"include/charls/jpegls_error.h",
55+
"include/charls/jpegls_error.hpp",
56+
"include/charls/public_types.h",
57+
"include/charls/undef_macros.h",
58+
"include/charls/validate_spiff_header.h",
59+
"include/charls/version.h",
60+
],
61+
strip_include_prefix = "include",
62+
visibility = ["//visibility:public"],
63+
)
64+
65+
cc_binary(
66+
name = "charls-test",
67+
srcs = [
68+
"src/default_traits.hpp",
69+
"src/lossless_traits.hpp",
70+
"test/bit_stream_damage.cpp",
71+
"test/bit_stream_damage.hpp",
72+
"test/compliance.cpp",
73+
"test/compliance.hpp",
74+
"test/main.cpp",
75+
"test/performance.cpp",
76+
"test/performance.hpp",
77+
"test/portable_anymap_file.hpp",
78+
"test/util.cpp",
79+
"test/util.hpp",
80+
],
81+
deps = [
82+
"//:charls",
83+
],
84+
)

CHANGELOG.md

+2-2
Original file line numberDiff line numberDiff line change
@@ -151,7 +151,7 @@ This has been done to make it possible to have different release cycles.
151151
### Removed
152152

153153
- The legacy methods JpegLsEncodeStream, JpegLsDecodeStream and JpegLsReadHeaderStream have been removed as exported methods.
154-
These methods were not part of the public API and only used by by the charlstest application
154+
These methods were not part of the public API and only used by by the charls-test application
155155

156156
### Fixed
157157

@@ -218,7 +218,7 @@ This has been done to make it possible to have different release cycles.
218218

219219
- Fixes [#10](https://github.com/team-charls/charls/issues/10), Fixed the problem that "output buffer to small" was not
220220
detected when writing encoded bytes to a fixed output buffer. This could cause memory corruption problems
221-
- Fixes [11](https://github.com/team-charls/charls/issues/11), Update charlstest to return EXIT_SUCCESS/FAILURE
221+
- Fixes [11](https://github.com/team-charls/charls/issues/11), Update charls-test to return EXIT_SUCCESS/FAILURE
222222
- Fixed the issue that DecodeToPnm would set params.colorTransform = ColorTransformation::BigEndian but the library didn’t support this option during decoding
223223

224224
## [1.1.0] - 2016-5-15

CMakeLists.txt

+3-3
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# Copyright (c) Team CharLS.
1+
# SPDX-FileCopyrightText: © 2009 Team CharLS
22
# SPDX-License-Identifier: BSD-3-Clause
33

44
cmake_minimum_required(VERSION 3.16...3.31)
@@ -228,10 +228,10 @@ if(CHARLS_BUILD_TESTS)
228228
enable_testing()
229229
add_subdirectory(test)
230230

231-
# The unit tests project depends on the VS C++ unit test framework. Use the -unittest option of the charlstest tool for other platforms.
231+
# The unit tests project depends on the VS C++ unit test framework. Use the -unittest option of the charls-test tool for other platforms.
232232
add_test(
233233
NAME basic-test
234-
COMMAND charlstest -unittest
234+
COMMAND charls-test -unittest
235235
WORKING_DIRECTORY ${CMAKE_CURRENT_LIST_DIR}
236236
)
237237
endif()

CharLS.sln.DotSettings

-1
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,6 @@
5656
<s:Boolean x:Key="/Default/UserDictionary/Words/=bugprone/@EntryIndexedValue">True</s:Boolean>
5757
<s:Boolean x:Key="/Default/UserDictionary/Words/=byteswap/@EntryIndexedValue">True</s:Boolean>
5858
<s:Boolean x:Key="/Default/UserDictionary/Words/=CHARLS/@EntryIndexedValue">True</s:Boolean>
59-
<s:Boolean x:Key="/Default/UserDictionary/Words/=charlstest/@EntryIndexedValue">True</s:Boolean>
6059
<s:Boolean x:Key="/Default/UserDictionary/Words/=cmove/@EntryIndexedValue">True</s:Boolean>
6160
<s:Boolean x:Key="/Default/UserDictionary/Words/=cmyk/@EntryIndexedValue">True</s:Boolean>
6261
<s:Boolean x:Key="/Default/UserDictionary/Words/=comparepnm/@EntryIndexedValue">True</s:Boolean>

MODULE.bazel

+2-3
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
21
# SPDX-FileCopyrightText: © 2025 Team CharLS
32
# SPDX-License-Identifier: BSD-3-Clause
43

@@ -9,8 +8,8 @@ This MODULE.bazel file defines the module and its dependencies for the CharLS pr
98
module(
109
name = "charls",
1110
version = "3.0.0",
11+
bazel_compatibility = [">=7.5.0"],
1212
compatibility_level = 3,
13-
bazel_compatibility = [">=7.5.0"]
1413
)
1514

16-
bazel_dep(name = "rules_cc", version = "0.1.1")
15+
bazel_dep(name = "rules_cc", version = "0.1.1")

src/BUILD.bazel

-8
This file was deleted.

test/CMakeLists.txt

+9-8
Original file line numberDiff line numberDiff line change
@@ -1,26 +1,27 @@
1-
# Copyright (c) Team CharLS.
1+
# SPDX-FileCopyrightText: © 2009 Team CharLS
22
# SPDX-License-Identifier: BSD-3-Clause
33

4-
add_executable(charlstest "")
4+
add_executable(charls-test "")
55

6-
target_sources(charlstest
6+
target_sources(charls-test
77
PRIVATE
8-
bitstreamdamage.cpp
9-
bitstreamdamage.hpp
8+
bit_stream_damage.cpp
9+
bit_stream_damage.hpp
1010
compliance.cpp
1111
compliance.hpp
1212
main.cpp
1313
performance.cpp
1414
performance.hpp
1515
util.cpp
1616
util.hpp
17+
portable_anymap_file.hpp
1718
)
1819

1920
if(WIN32 AND MSVC_VERSION GREATER_EQUAL 1920)
2021
# Only add the manifest file when building a Windows app
21-
target_sources(charlstest PRIVATE app.manifest)
22+
target_sources(charls-test PRIVATE app.manifest)
2223
endif()
2324

24-
set_target_properties(charlstest PROPERTIES CXX_VISIBILITY_PRESET hidden)
25+
set_target_properties(charls-test PROPERTIES CXX_VISIBILITY_PRESET hidden)
2526

26-
target_link_libraries(charlstest PRIVATE charls)
27+
target_link_libraries(charls-test PRIVATE charls)

test/CharLSTest.vcxproj

+2-2
Original file line numberDiff line numberDiff line change
@@ -174,14 +174,14 @@
174174
</Link>
175175
</ItemDefinitionGroup>
176176
<ItemGroup>
177-
<ClCompile Include="bitstreamdamage.cpp" />
177+
<ClCompile Include="bit_stream_damage.cpp" />
178178
<ClCompile Include="compliance.cpp" />
179179
<ClCompile Include="main.cpp" />
180180
<ClCompile Include="performance.cpp" />
181181
<ClCompile Include="util.cpp" />
182182
</ItemGroup>
183183
<ItemGroup>
184-
<ClInclude Include="bitstreamdamage.hpp" />
184+
<ClInclude Include="bit_stream_damage.hpp" />
185185
<ClInclude Include="compliance.hpp" />
186186
<ClInclude Include="portable_anymap_file.hpp" />
187187
<ClInclude Include="performance.hpp" />

test/CharLSTest.vcxproj.filters

+2-2
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
</Filter>
1515
</ItemGroup>
1616
<ItemGroup>
17-
<ClCompile Include="bitstreamdamage.cpp">
17+
<ClCompile Include="bit_stream_damage.cpp">
1818
<Filter>Source Files</Filter>
1919
</ClCompile>
2020
<ClCompile Include="compliance.cpp">
@@ -34,7 +34,7 @@
3434
<ClInclude Include="util.hpp">
3535
<Filter>Header Files</Filter>
3636
</ClInclude>
37-
<ClInclude Include="bitstreamdamage.hpp">
37+
<ClInclude Include="bit_stream_damage.hpp">
3838
<Filter>Header Files</Filter>
3939
</ClInclude>
4040
<ClInclude Include="compliance.hpp">

test/bitstreamdamage.cpp test/bit_stream_damage.cpp

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
// Copyright (c) Team CharLS.
22
// SPDX-License-Identifier: BSD-3-Clause
33

4-
#include "bitstreamdamage.hpp"
4+
#include "bit_stream_damage.hpp"
55
#include "util.hpp"
66

77
#include <iostream>
File renamed without changes.

test/main.cpp

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
1-
// Copyright (c) Team CharLS.
1+
// SPDX-FileCopyrightText: © 2016 Team CharLS
22
// SPDX-License-Identifier: BSD-3-Clause
33

44
#include "../src/default_traits.hpp"
55
#include "../src/lossless_traits.hpp"
66

7-
#include "bitstreamdamage.hpp"
7+
#include "bit_stream_damage.hpp"
88
#include "compliance.hpp"
99
#include "performance.hpp"
1010
#include "util.hpp"

0 commit comments

Comments
 (0)