File tree Expand file tree Collapse file tree 4 files changed +27
-5
lines changed Expand file tree Collapse file tree 4 files changed +27
-5
lines changed Original file line number Diff line number Diff line change 21
21
mkdir ${{runner.workspace}}/llvm
22
22
tar -xf clang+llvm-11.0.0-x86_64-linux-gnu-ubuntu-20.04.tar.xz -C ${{runner.workspace}}/llvm
23
23
echo "${{runner.workspace}}/llvm/clang+llvm-11.0.0-x86_64-linux-gnu-ubuntu-20.04/bin" >> $GITHUB_PATH
24
-
24
+
25
25
- uses : actions/checkout@v2
26
26
with :
27
27
submodules : ' true'
41
41
- name : Run Example
42
42
working-directory : ${{runner.workspace}}/build
43
43
shell : bash
44
- run : ./${{runner.workspace}}/build/ Example
44
+ run : ./Example
Original file line number Diff line number Diff line change @@ -11,4 +11,26 @@ target_link_libraries(Example MetaCPP)
11
11
12
12
# MetaCPP automatic reflection
13
13
include (../CMake/MetaPrebuild.cmake )
14
- meta_generate (Example "objects.hpp" "Generated.hpp" "Generated.cpp" "" )
14
+
15
+ if (NOT DEFINED META_GENERATE_FLAGS )
16
+ set (META_GENERATE_FLAGS "" )
17
+ endif ()
18
+ if (DEFINED CLANG_INCLUDE_DIR )
19
+ set (META_GENERATE_FLAGS "${META_GENERATE_FLAGS} --flag -I${CLANG_INCLUDE_DIR} " )
20
+ else ()
21
+ # Fire all weapons
22
+ set (CLANG_INCLUDE_CANDIDATES "/usr/local/lib/clang/12.0.0/include" )
23
+ set (CLANG_INCLUDE_CANDIDATES "${CLANG_INCLUDE_CANDIDATES} ;/usr/lib/llvm-12/lib/clang/12.0.0/include" )
24
+ set (CLANG_INCLUDE_CANDIDATES "${CLANG_INCLUDE_CANDIDATES} ;/usr/local/lib/clang/11.0.0/include" )
25
+ set (CLANG_INCLUDE_CANDIDATES "${CLANG_INCLUDE_CANDIDATES} ;/usr/lib/llvm-11/lib/clang/11.0.0/include" )
26
+ set (CLANG_INCLUDE_CANDIDATES "${CLANG_INCLUDE_CANDIDATES} ;/usr/local/lib/clang/10.0.0/include" )
27
+ set (CLANG_INCLUDE_CANDIDATES "${CLANG_INCLUDE_CANDIDATES} ;/usr/lib/llvm-10/lib/clang/10.0.0/include" )
28
+ foreach (CLANG_INCLUDE_CANDIDATE ${CLANG_INCLUDE_CANDIDATES} )
29
+ if (EXISTS ${CLANG_INCLUDE_CANDIDATE} )
30
+ set (META_GENERATE_FLAGS "${META_GENERATE_FLAGS} --flag -I${CLANG_INCLUDE_CANDIDATE} " )
31
+ break ()
32
+ endif ()
33
+ endforeach ()
34
+ endif ()
35
+
36
+ meta_generate (Example "objects.hpp" "Generated.hpp" "Generated.cpp" "${META_GENERATE_FLAGS} " )
Original file line number Diff line number Diff line change @@ -10,7 +10,7 @@ find_Package(Clang REQUIRED)
10
10
11
11
# LLVM
12
12
link_directories (${LLVM_LIB_DIR} )
13
- # add_definitions(${LLVM_COMPILE_FLAGS})
13
+ #add_definitions(${LLVM_COMPILE_FLAGS})
14
14
add_definitions (-fno-rtti ) # this should match the LLVM rtti flag
15
15
16
16
set (MetaCPPCLI_SRC_DIR ${CMAKE_CURRENT_SOURCE_DIR} )
Original file line number Diff line number Diff line change @@ -183,7 +183,7 @@ namespace metacpp {
183
183
184
184
bool Type::HasSize () const {
185
185
const std::string& name = m_QualifiedName.GetName ();
186
- return name != " void" && name != " _Alloc_hider" ;
186
+ return name != " void" && name != " _Alloc_hider" && m_Access == AccessSpecifier::PUBLIC ;
187
187
}
188
188
189
189
const std::vector<Method>& Type::GetMethods () const {
You can’t perform that action at this time.
0 commit comments