1. Make resource dir unique and global.

2. Use our custom CDB loader.
This commit is contained in:
ykiko
2024-12-10 16:15:50 +08:00
parent f9bff085b2
commit c082458fb1
16 changed files with 332 additions and 194 deletions

View File

@@ -1,16 +1,41 @@
#include "../Test.h"
// #include "Compiler/Command.h"
//
// namespace {
//
// TEST(clice, CommandManager) {
// clice::CommandManager manager("/home/ykiko/C++/clice2/tests");
// auto args = manager.lookup("another_file.cpp");
// for(auto arg: args) {
// llvm::outs() << arg << " ";
// }
// llvm::outs() << "\n";
// }
//
// } // namespace
#include "Compiler/Command.h"
namespace clice {
namespace {
TEST(clice, Command) {
llvm::SmallString<1024> buffer;
llvm::SmallVector<const char*, 16> args;
auto command =
"/usr/local/bin/clang++"
" -Dclice_core_EXPORTS"
" -I/home/ykiko/C++/clice2/deps/llvm/build-install/include"
" -I/home/ykiko/C++/clice2/include"
" -I/home/ykiko/C++/clice2/deps/toml/include"
" -I/home/ykiko/C++/clice2/deps/libuv/include"
" -fno-rtti"
" -fno-exceptions"
" -g -O0 -fsanitize=address"
" -Wno-deprecated-declarations"
" -g -std=gnu++23 -fPIC -Winvalid-pch"
" -Xclang -include-pch"
" -Xclang /home/ykiko/C++/clice2/build/CMakeFiles/clice-core.dir/cmake_pch.hxx.pch"
" -Xclang -include -Xclang /home/ykiko/C++/clice2/build/CMakeFiles/clice-core.dir/cmake_pch.hxx"
" -o CMakeFiles/clice-core.dir/src/Basic/URI.cpp.o"
" -c /home/ykiko/C++/clice2/src/Basic/URI.cpp";
auto error = mangleCommand(command, args, buffer);
ASSERT_FALSE(bool(error));
for(auto arg: args) {
llvm::outs() << arg << '\n';
}
}
} // namespace
} // namespace clice