Move tooling to subproject

This commit is contained in:
Guus Waals 2025-05-25 16:10:17 +08:00
parent 5b8a014013
commit 55aa93eee2
4 changed files with 19 additions and 7 deletions

5
.gitignore vendored
View File

@ -21,3 +21,8 @@ ACP_Ray2/
build/
# game_re/
windows_libs/
tooling/build/
*.code-workspace
*.log
.edits_backup/

View File

@ -5,11 +5,5 @@ set(GAME_DATA_DIR ${CMAKE_CURRENT_SOURCE_DIR}/game)
add_subdirectory(game_re)
option(BUILD_TOOLING "Build the ghidra tooling" ON)
if(BUILD_TOOLING)
add_subdirectory(tooling)
endif()
# Use highest possible C standard
set_target_properties(game_re PROPERTIES C_STANDARD 23)

View File

@ -1,3 +1,6 @@
cmake_minimum_required(VERSION 3.26.4)
project(reman3_tooling)
set(LLVM_PATH "" CACHE STRING "Path to the LLVM source tree")
set(LLVM_ADD_PATH ${LLVM_PATH}/llvm)
@ -19,11 +22,20 @@ set(LLVM_INCLUDE_BENCHMARKS OFF CACHE BOOL "" FORCE)
set(LLVM_TARGETS_TO_BUILD "X86" CACHE STRING "" FORCE)
set(LLVM_ENABLE_PROJECTS "clang" CACHE STRING "" FORCE)
add_subdirectory(${LLVM_ADD_PATH} ${CMAKE_BINARY_DIR}/external/llvm)
set(LLVM_BINARY_DIR ${CMAKE_BINARY_DIR}/external/llvm)
add_subdirectory(${LLVM_ADD_PATH} ${LLVM_BINARY_DIR})
add_subdirectory(../game_re/third_party/spdlog spdlog)
# Add the clang tooling executable
add_executable(clang_tool main.cpp)
target_include_directories(clang_tool PRIVATE
${LLVM_PATH}/llvm/include
${LLVM_PATH}/clang/include
${LLVM_BINARY_DIR}/include
${LLVM_BINARY_DIR}/tools/clang/include
)
# Link against clang tooling libraries
target_link_libraries(clang_tool
clangTooling

View File

@ -6,6 +6,7 @@
#include "clang/Tooling/Tooling.h"
#include "llvm/Support/CommandLine.h"
#include <spdlog/spdlog.h>
#include "clang/AST/ASTConcept.h"
using namespace clang;
using namespace clang::tooling;