Fixed building on LLVM < 14 (#266)

This commit is contained in:
Bartek Kryza
2024-05-14 17:27:34 +02:00
parent 27eaea5bbe
commit 6d3d1ae450
4 changed files with 17 additions and 30 deletions

View File

@@ -5,6 +5,8 @@ cmake_minimum_required(VERSION 3.16)
#
project(clang-uml C CXX)
cmake_policy(SET CMP0054 NEW)
#
# CMake standard defines
#

View File

@@ -248,10 +248,24 @@ void generator::generate(const class_ &c, nlohmann::json &parent) const
{
nlohmann::json object = c;
// Perform config dependent postprocessing on generated class;
if (!config().generate_fully_qualified_name())
object["display_name"] =
common::generators::json::render_name(c.full_name_no_ns());
for (auto &tp : object["template_parameters"]) {
if (tp.contains("type") && tp.at("type").is_string()) {
tp["type"] = config().using_namespace().relative(tp.at("type"));
}
}
for (auto &tp : object["members"]) {
if (tp.contains("type") && tp.at("type").is_string()) {
tp["type"] = config().using_namespace().relative(tp.at("type"));
}
}
std::string object_str = object.dump(2);
parent["elements"].push_back(std::move(object));
}

View File

@@ -6,7 +6,7 @@ file(GLOB_RECURSE TEST_CONFIG_YMLS test_config_data/*.yml
test_compilation_database_data/*.yml
test_compilation_database_data/*.json)
set(TEST_CASES_REQUIRING_CXX20 t00056 t00058 t00059 t00065 t00069)
set(TEST_CASES_REQUIRING_CXX20 t00056 t00058 t00059 t00065 t00069 t00074 t00075)
set(TEST_CASES_REQUIRING_CXX20_MODULES t00070 t00071 t00072
t30012 t30013 t30014 t30015)
set(TEST_CASES_REQUIRING_CUDA t20049 t20050 t20051)

View File

@@ -1300,33 +1300,4 @@ int main(int argc, char *argv[])
return res;
return res;
/*
Catch::Session session;
using namespace Catch::clara;
bool debug_log{false};
auto cli = session.cli() |
Opt(debug_log, "debug_log")["-u"]["--debug-log"]("Enable debug logs");
session.cli(cli);
int returnCode = session.applyCommandLine(argc, argv);
if (returnCode != 0)
return returnCode;
clanguml::cli::cli_handler clih;
std::vector<const char *> argvv = {
"clang-uml", "--config", "./test_config_data/simple.yml"};
if (debug_log)
argvv.push_back("-vvv");
else
argvv.push_back("-q");
clih.handle_options(argvv.size(), argvv.data());
return session.run();
*/
}