Skip to content
Open
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
4 changes: 2 additions & 2 deletions src/CppAst/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
file(GLOB_RECURSE SOURCE_FILES ${CMAKE_CURRENT_SOURCE_DIR}/*.cs)

set(CMAKE_CSharp_FLAGS "${CMAKE_CSharp_FLAGS} /langversion:7.3")
set(CMAKE_CSharp_FLAGS "${CMAKE_CSharp_FLAGS} /langversion:10")

add_library(CppAst SHARED ${SOURCE_FILES})

set_target_properties(CppAst PROPERTIES
VS_PACKAGE_REFERENCES "ClangSharp_17.0.1;Irony_1.2.0"
VS_PACKAGE_REFERENCES "ClangSharp_20.1.2;Irony_1.2.0"
)

target_compile_options(CppAst PUBLIC "/unsafe")
12 changes: 11 additions & 1 deletion src/CppAst/CppContainerList.cs
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,17 @@ public void AddRange(IEnumerable<TElement> collection)
{
foreach (var element in collection)
{
Add(element);
// Check if given element is already resolved
if (element.Parent == null)
{
// If not, create one
Add(element);
}
else
{
// Otherwise, just reference it
_elements.Add(element);
}
}
}
}
Expand Down
Loading