Skip to content

Commit

Permalink
build: remove c++ codegen, ref #149
Browse files Browse the repository at this point in the history
  • Loading branch information
iboB committed Dec 3, 2024
1 parent eb76ef4 commit b1a0ee0
Show file tree
Hide file tree
Showing 4 changed files with 3 additions and 303 deletions.
2 changes: 1 addition & 1 deletion cmake/ac_local_plugin_util.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ include_guard(GLOBAL)
include(ac_local_lib)

function(add_ac_local_plugin)
cmake_parse_arguments(ARG "" "NAME;PUBLIC_SUFFIX" "SOURCES;SCHEMAS;PLUGIN_SOURCES;PLIB_SOURCES;LIBRARIES" ${ARGN})
cmake_parse_arguments(ARG "" "NAME;PUBLIC_SUFFIX" "SOURCES;PLUGIN_SOURCES;PLIB_SOURCES;LIBRARIES" ${ARGN})

# private names for targets which are not installed and never leave the project
set(aclpName aclp-${ARG_NAME})
Expand Down
3 changes: 1 addition & 2 deletions schema/code/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,7 @@ set_target_properties(ac-schema PROPERTIES
EXPORT_NAME ac::schema
)
target_link_libraries(ac-schema INTERFACE
ac::astl
ac::dict
ac::local
)
target_sources(ac-schema INTERFACE FILE_SET HEADERS FILES
ac/schema/CallHelpers.hpp
Expand Down
258 changes: 0 additions & 258 deletions schema/code/generate-cpp-for-ac-model-schema.rb

This file was deleted.

43 changes: 1 addition & 42 deletions schema/test/t-DispatchHelpers.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -4,47 +4,6 @@
#include <ac/schema/DispatchHelpers.hpp>
#include <ac/Dict.hpp>
#include <doctest/doctest.h>
#include <string>
#include <string_view>
#include <cstdlib>

struct Schema {
struct ElemA {
static constexpr auto id = "elem-a";
using Params = int;
};
struct ElemB {
static constexpr auto id = "elem-b";
using Params = std::string;
};
struct ElemC {
static constexpr auto id = "elem-c";
using Params = double;
};
using Elems = std::tuple<ElemA, ElemB, ElemC>;
};

struct Dispatcher {
int on(Schema::ElemA, int i) {
return i + 5;
}
std::string on(Schema::ElemB, const std::string& s) {
return s + "!";
}
int on(Schema::ElemC, double d) {
return int(d);
}
std::string on(std::string_view badId, ac::Dict) {
return on({}, std::string(badId));
}
};

TEST_CASE("dispatchById") {
Schema::Elems elems;
Dispatcher disp;

//CHECK(ac::local::schema::dispatchById<Schema::Elems>("elem-a", ac::Dict(5), disp) == "5");
//CHECK(ac::local::schema::dispatchById<Schema::Elems>("elem-b", ac::Dict("hi"), disp) == "hi!");
//CHECK(ac::local::schema::dispatchById<Schema::Elems>("elem-c", ac::Dict(3.14), disp) == "3");
//CHECK(ac::local::schema::dispatchById<Schema::Elems>("nope", ac::Dict(nullptr), disp) == "nope!");
TEST_CASE("OpDispatcherData") {
}

0 comments on commit b1a0ee0

Please sign in to comment.