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
This commit is contained in:
bcsgh 2025-03-12 15:57:16 -07:00 committed by GitHub
parent ba004477a6
commit 037752d9a1
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
5 changed files with 24 additions and 3 deletions

4
.gitignore vendored
View File

@ -55,3 +55,7 @@ compile_commands.json
# temps
/version
# Bazel output paths
/bazel-*
/MODULE.bazel.lock

View File

@ -55,12 +55,13 @@ endif()
set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} "${CMAKE_CURRENT_SOURCE_DIR}/cmake")
project(jsoncpp
# Note: version must be updated in three places when doing a release. This
# Note: version must be updated in four places when doing a release. This
# annoying process ensures that amalgamate, CMake, and meson all report the
# correct version.
# 1. ./meson.build
# 2. ./include/json/version.h
# 3. ./CMakeLists.txt
# 4. ./MODULE.bazel
# IMPORTANT: also update the PROJECT_SOVERSION!!
VERSION 1.9.7 # <major>[.<minor>[.<patch>[.<tweak>]]]
LANGUAGES CXX)

14
MODULE.bazel Normal file
View File

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

View File

@ -1,12 +1,13 @@
#ifndef JSON_VERSION_H_INCLUDED
#define JSON_VERSION_H_INCLUDED
// Note: version must be updated in three places when doing a release. This
// Note: version must be updated in four places when doing a release. This
// annoying process ensures that amalgamate, CMake, and meson all report the
// correct version.
// 1. /meson.build
// 2. /include/json/version.h
// 3. /CMakeLists.txt
// 4. /MODULE.bazel
// IMPORTANT: also update the SOVERSION!!
#define JSONCPP_VERSION_STRING "1.9.7"

View File

@ -2,12 +2,13 @@ project(
'jsoncpp',
'cpp',
# Note: version must be updated in three places when doing a release. This
# Note: version must be updated in four places when doing a release. This
# annoying process ensures that amalgamate, CMake, and meson all report the
# correct version.
# 1. /meson.build
# 2. /include/json/version.h
# 3. /CMakeLists.txt
# 4. /MODULE.bazel
# IMPORTANT: also update the SOVERSION!!
version : '1.9.7',
default_options : [