bootstrap: Unconditionally build libjsoncpp

This commit is contained in:
Kyle Edwards
2023-07-21 12:01:01 -04:00
parent 8129bf85ed
commit 93ed53790c
2 changed files with 24 additions and 35 deletions

View File

@@ -38,7 +38,6 @@ using ObjectErrorGenerator =
std::function<ErrorGenerator(ObjectError, const Json::Value::Members&)>;
const auto EXPECTED_TYPE = [](const std::string& type) {
return [type](const Json::Value* value, cmJSONState* state) -> void {
#if !defined(CMAKE_BOOTSTRAP)
if (state->key().empty()) {
state->AddErrorAtValue(cmStrCat("Expected ", type), value);
return;
@@ -48,7 +47,6 @@ const auto EXPECTED_TYPE = [](const std::string& type) {
errMsg = cmStrCat(errMsg, ", got: ", value->asString());
}
state->AddErrorAtValue(errMsg, value);
#endif
};
};
const auto INVALID_STRING = [](const Json::Value* value,
@@ -75,7 +73,6 @@ const auto INVALID_NAMED_OBJECT =
const Json::Value::Members& extraFields) -> ErrorGenerator {
return [nameGenerator, errorType, extraFields](
const Json::Value* value, cmJSONState* state) -> void {
#if !defined(CMAKE_BOOTSTRAP)
std::string name = nameGenerator(value, state);
switch (errorType) {
case ObjectError::RequiredMissing:
@@ -102,7 +99,6 @@ const auto INVALID_NAMED_OBJECT =
value);
break;
}
#endif
};
};
};

View File

@@ -414,6 +414,7 @@ CMAKE_CXX_SOURCES="\
cmInstallTargetGenerator \
cmInstallTargetsCommand \
cmInstalledFile \
cmJSONState \
cmLDConfigLDConfigTool \
cmLDConfigTool \
cmLinkDirectoriesCommand \
@@ -588,6 +589,12 @@ LIBRHASH_C_SOURCES="\
librhash/sha512.c \
"
JSONCPP_CXX_SOURCES="\
src/lib_json/json_reader.cpp \
src/lib_json/json_value.cpp \
src/lib_json/json_writer.cpp \
"
if ${cmake_system_mingw}; then
LIBUV_C_SOURCES="\
src/fs-poll.c \
@@ -1091,12 +1098,6 @@ if test "${cmake_bootstrap_generator}" = "Ninja"; then
cmFortranLexer \
cmFortranParser \
"
JSONCPP_CXX_SOURCES="\
src/lib_json/json_reader.cpp \
src/lib_json/json_value.cpp \
src/lib_json/json_writer.cpp \
"
else
CMAKE_CXX_SOURCES="${CMAKE_CXX_SOURCES} \
cmDepends \
@@ -1110,8 +1111,6 @@ else
cmMakefileUtilityTargetGenerator \
cmProcessTools \
"
JSONCPP_CXX_SOURCES=
fi
# Add Cygwin-specific flags
@@ -1725,12 +1724,10 @@ if test "x${bootstrap_system_librhash}" = "x"; then
objs="${objs} rhash-`cmake_obj ${a}`"
done
fi
if test "${cmake_bootstrap_generator}" = "Ninja"; then
if test "x${bootstrap_system_jsoncpp}" = "x"; then
for a in ${JSONCPP_CXX_SOURCES}; do
objs="${objs} jsoncpp-`cmake_obj ${a}`"
done
fi
if test "x${bootstrap_system_jsoncpp}" = "x"; then
for a in ${JSONCPP_CXX_SOURCES}; do
objs="${objs} jsoncpp-`cmake_obj ${a}`"
done
fi
libs=""
@@ -1799,17 +1796,15 @@ if test "x${bootstrap_system_librhash}" != "x"; then
libs="${libs} -lrhash"
fi
if test "${cmake_bootstrap_generator}" = "Ninja"; then
jsoncpp_cxx_flags=
if test "x${bootstrap_system_jsoncpp}" = "x"; then
jsoncpp_cxx_flags="${jsoncpp_cxx_flags} `cmake_escape_shell "-I${cmake_source_dir}/Utilities/cmjsoncpp/include"`"
else
if test `which pkg-config`; then
use_jsoncpp_flags="`pkg-config --cflags jsoncpp`"
cmake_cxx_flags="${cmake_cxx_flags} ${use_jsoncpp_flags}"
fi
libs="${libs} -ljsoncpp"
jsoncpp_cxx_flags=
if test "x${bootstrap_system_jsoncpp}" = "x"; then
jsoncpp_cxx_flags="${jsoncpp_cxx_flags} `cmake_escape_shell "-I${cmake_source_dir}/Utilities/cmjsoncpp/include"`"
else
if test `which pkg-config`; then
use_jsoncpp_flags="`pkg-config --cflags jsoncpp`"
cmake_cxx_flags="${cmake_cxx_flags} ${use_jsoncpp_flags}"
fi
libs="${libs} -ljsoncpp"
fi
if test "x${cmake_ansi_cxx_flags}" != "x"; then
@@ -1949,13 +1944,11 @@ if test "x${bootstrap_system_librhash}" = "x"; then
write_source_rule "c" "rhash-`cmake_obj ${a}`" "${src}" ""
done
fi
if test "${cmake_bootstrap_generator}" = "Ninja"; then
if test "x${bootstrap_system_jsoncpp}" = "x"; then
for a in ${JSONCPP_CXX_SOURCES}; do
src=`cmake_escape_artifact "${cmake_source_dir}/Utilities/cmjsoncpp/${a}"`
write_source_rule "cxx" "jsoncpp-`cmake_obj ${a}`" "${src}" "${jsoncpp_cxx_flags}"
done
fi
if test "x${bootstrap_system_jsoncpp}" = "x"; then
for a in ${JSONCPP_CXX_SOURCES}; do
src=`cmake_escape_artifact "${cmake_source_dir}/Utilities/cmjsoncpp/${a}"`
write_source_rule "cxx" "jsoncpp-`cmake_obj ${a}`" "${src}" "${jsoncpp_cxx_flags}"
done
fi
if test "${cmake_bootstrap_generator}" = "Ninja"; then
echo "