Remove dependency on system include dir
This commit is contained in:
parent
824f19effd
commit
8a60d52be1
5 changed files with 58 additions and 25 deletions
|
|
@ -23,9 +23,15 @@ void require_flags(const libclang_compile_config& config, const char* flags)
|
|||
{
|
||||
std::string result;
|
||||
auto config_flags = detail::libclang_compile_config_access::flags(config);
|
||||
// skip first 4, those are the default options
|
||||
for (auto iter = config_flags.begin() + 4; iter != config_flags.end(); ++iter)
|
||||
result += *iter + ' ';
|
||||
// skip until including __cppast_version__minor__, those are the default options
|
||||
auto in_default = true;
|
||||
for (auto iter = config_flags.begin(); iter != config_flags.end(); ++iter)
|
||||
{
|
||||
if (*iter == "-D__cppast_version_minor__=\"" CPPAST_VERSION_MINOR "\"")
|
||||
in_default = false;
|
||||
else if (!in_default)
|
||||
result += *iter + ' ';
|
||||
}
|
||||
result.pop_back();
|
||||
REQUIRE(result == flags);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -23,14 +23,21 @@ inline void write_file(const char* name, const char* code)
|
|||
file << code;
|
||||
}
|
||||
|
||||
inline std::unique_ptr<cppast::cpp_file> parse_file(const cppast::cpp_entity_index& idx,
|
||||
const char* name,
|
||||
bool fast_preprocessing = false)
|
||||
inline cppast::libclang_compile_config make_test_config()
|
||||
{
|
||||
using namespace cppast;
|
||||
|
||||
libclang_compile_config config;
|
||||
config.set_flags(cpp_standard::cpp_latest);
|
||||
return config;
|
||||
}
|
||||
|
||||
inline std::unique_ptr<cppast::cpp_file> parse_file(const cppast::cpp_entity_index& idx,
|
||||
const char* name,
|
||||
bool fast_preprocessing = false)
|
||||
{
|
||||
using namespace cppast;
|
||||
static auto config = make_test_config();
|
||||
config.fast_preprocessing(fast_preprocessing);
|
||||
|
||||
libclang_parser p(default_logger());
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue