Skip to content

Commit 037752d

Browse files
authored
Set up for Bazel module builds. (#1597)
* Set up for Bazel module builds. Note: the MODULE.bazel is copied from https://github.com/bazelbuild/bazel-central-registry/blob/main/modules/jsoncpp/1.9.6/MODULE.bazel * More tweaks to .gitignore
1 parent ba00447 commit 037752d

File tree

5 files changed

+24
-3
lines changed

5 files changed

+24
-3
lines changed

.gitignore

+4
Original file line numberDiff line numberDiff line change
@@ -55,3 +55,7 @@ compile_commands.json
5555

5656
# temps
5757
/version
58+
59+
# Bazel output paths
60+
/bazel-*
61+
/MODULE.bazel.lock

CMakeLists.txt

+2-1
Original file line numberDiff line numberDiff line change
@@ -55,12 +55,13 @@ endif()
5555
set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} "${CMAKE_CURRENT_SOURCE_DIR}/cmake")
5656

5757
project(jsoncpp
58-
# Note: version must be updated in three places when doing a release. This
58+
# Note: version must be updated in four places when doing a release. This
5959
# annoying process ensures that amalgamate, CMake, and meson all report the
6060
# correct version.
6161
# 1. ./meson.build
6262
# 2. ./include/json/version.h
6363
# 3. ./CMakeLists.txt
64+
# 4. ./MODULE.bazel
6465
# IMPORTANT: also update the PROJECT_SOVERSION!!
6566
VERSION 1.9.7 # <major>[.<minor>[.<patch>[.<tweak>]]]
6667
LANGUAGES CXX)

MODULE.bazel

+14
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
module(
2+
name = "jsoncpp",
3+
4+
# Note: version must be updated in four places when doing a release. This
5+
# annoying process ensures that amalgamate, CMake, and meson all report the
6+
# correct version.
7+
# 1. /meson.build
8+
# 2. /include/json/version.h
9+
# 3. /CMakeLists.txt
10+
# 4. /MODULE.bazel
11+
# IMPORTANT: also update the SOVERSION!!
12+
version = "1.9.7",
13+
compatibility_level = 1,
14+
)

include/json/version.h

+2-1
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,13 @@
11
#ifndef JSON_VERSION_H_INCLUDED
22
#define JSON_VERSION_H_INCLUDED
33

4-
// Note: version must be updated in three places when doing a release. This
4+
// Note: version must be updated in four places when doing a release. This
55
// annoying process ensures that amalgamate, CMake, and meson all report the
66
// correct version.
77
// 1. /meson.build
88
// 2. /include/json/version.h
99
// 3. /CMakeLists.txt
10+
// 4. /MODULE.bazel
1011
// IMPORTANT: also update the SOVERSION!!
1112

1213
#define JSONCPP_VERSION_STRING "1.9.7"

meson.build

+2-1
Original file line numberDiff line numberDiff line change
@@ -2,12 +2,13 @@ project(
22
'jsoncpp',
33
'cpp',
44

5-
# Note: version must be updated in three places when doing a release. This
5+
# Note: version must be updated in four places when doing a release. This
66
# annoying process ensures that amalgamate, CMake, and meson all report the
77
# correct version.
88
# 1. /meson.build
99
# 2. /include/json/version.h
1010
# 3. /CMakeLists.txt
11+
# 4. /MODULE.bazel
1112
# IMPORTANT: also update the SOVERSION!!
1213
version : '1.9.7',
1314
default_options : [

0 commit comments

Comments
 (0)