Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 17 additions & 0 deletions cmake/FindRPCGenerator.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -133,6 +133,18 @@ function(
else()
message("target ${dep}_generate does not exist so skipped")
endif()
# when installed (used through a package) idl dependencies can be found through their *_host (or *_enclave) targets:
# we know that <package_dir>/${param_install_dir}/interfaces/include is in the target's include directories, and
# that the idls themselves are in <package_dir>/${param_install_dir}
if(TARGET ${dep}_host)
get_target_property(include_dirs ${dep}_host INTERFACE_INCLUDE_DIRECTORIES)
foreach(include_dir ${include_dirs})
if(${include_dir} MATCHES "/interfaces/include$")
string(REPLACE "/interfaces/include" "" idl_dir ${include_dir})
set(PATHS_PARAMS ${PATHS_PARAMS} --path ${idl_dir})
endif()
endforeach()
endif()
endforeach()

if(NOT ${namespace} STREQUAL "")
Expand Down Expand Up @@ -402,12 +414,17 @@ function(
endif()

if(params_install_dir)
# install the files when creating a package
install(DIRECTORY "$<BUILD_INTERFACE:${output_path}/include/${sub_directory}>"
DESTINATION ${params_install_dir}/interfaces/include)
install(DIRECTORY "$<BUILD_INTERFACE:${output_path}/src/${sub_directory}>"
DESTINATION ${params_install_dir}/interfaces/src)
install(DIRECTORY "$<BUILD_INTERFACE:${output_path}/check_sums/${sub_directory}>"
DESTINATION ${params_install_dir}/interfaces/check_sums)
install(FILES "$<BUILD_INTERFACE:${idl}>" DESTINATION ${params_install_dir}/${idl_relative_dir})
# make sure the files can be found when used through a package
target_include_directories(${name}_idl_host INTERFACE $<INSTALL_INTERFACE:${params_install_dir}/interfaces/include>)
target_include_directories(${name}_idl_enclave
INTERFACE $<INSTALL_INTERFACE:${params_install_dir}/interfaces/include>)
endif()
endfunction()
7 changes: 4 additions & 3 deletions generator/src/json_schema/generator.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
#include "cpp_parser.h" // Your parser API header
#include "json_schema/generator.h"
#include "json_schema/writer.h"
#include <cstdint>
#include <iostream>
#include <string>
#include <vector>
Expand Down Expand Up @@ -335,7 +336,7 @@ namespace json_schema_generator
writer.write_string_property("type", "integer");
writer.write_key("enum");
writer.open_array();
int next_value = 0;
int64_t next_value = 0;
std::vector<std::string> value_descriptions;
using underlying = std::underlying_type<entity_type>::type;
const entity_type ALL_POSSIBLE_MEMBERS
Expand All @@ -348,7 +349,7 @@ namespace json_schema_generator
std::string enum_value_name = clean_type_name(element_ptr->get_name());
if (!enum_value_name.empty() && enum_value_name.find_first_of("{}[]() \t\n\r") == std::string::npos)
{
int assigned_value = next_value;
int64_t assigned_value = next_value;
const function_entity* value_entity = dynamic_cast<const function_entity*>(element_ptr.get());
if (value_entity)
{
Expand All @@ -357,7 +358,7 @@ namespace json_schema_generator
{
try
{
assigned_value = std::stoi(explicit_value_str);
assigned_value = std::stoll(explicit_value_str);
}
catch (const std::exception& e)
{
Expand Down