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
78 changes: 78 additions & 0 deletions clang/tools/ai-powered-reviewer-suggestion-tool/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,78 @@
# Build directories
build/
bin/
lib/
cmake-build-*/

# Model files (too large for git)
models/*.onnx
models/*.bin
models/*.safetensors

# Keep vocab.txt as it's small
!models/vocab.txt

# IDE files
.vscode/
.idea/
*.swp
*.swo
*~

# macOS specific
.DS_Store
.AppleDouble
.LSOverride

# Thumbnails
._*

# Files that might appear in the root of a volume
.DocumentRevisions-V100
.fseventsd
.Spotlight-V100
.TemporaryItems
.Trashes
.VolumeIcon.icns
.com.apple.timemachine.donotpresent

# Directories potentially created on remote AFP share
.AppleDB
.AppleDesktop
Network Trash Folder
Temporary Items
.apdisk

# CMake
CMakeCache.txt
CMakeFiles/
cmake_install.cmake
Makefile

# Compiled Object files
*.o
*.obj

# Executables
*.exe
*.out
*.app
reviewer-suggester

# Debug files
*.dSYM/
*.su
*.idb
*.pdb

# Logs
*.log

# Temporary files
*.tmp
*.temp

# API tokens and secrets
.env
*.token
secrets.txt
71 changes: 71 additions & 0 deletions clang/tools/ai-powered-reviewer-suggestion-tool/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,71 @@
cmake_minimum_required(VERSION 3.15)
project(reviewer-suggester C CXX)

set(CMAKE_CXX_STANDARD 17)
set(CMAKE_CXX_STANDARD_REQUIRED ON)

# Find required packages
find_package(LLVM REQUIRED CONFIG)
find_package(CURL REQUIRED)
find_package(nlohmann_json REQUIRED)

# Find ONNX Runtime
find_path(ONNXRUNTIME_INCLUDE_DIR onnxruntime_cxx_api.h PATHS /opt/homebrew/include/onnxruntime /usr/local/include/onnxruntime)
find_library(ONNXRUNTIME_LIB onnxruntime PATHS /opt/homebrew/lib /usr/local/lib)

if(NOT ONNXRUNTIME_INCLUDE_DIR OR NOT ONNXRUNTIME_LIB)
message(FATAL_ERROR "ONNX Runtime not found. Please install it via 'brew install onnxruntime'")
endif()

message(STATUS "ONNX Runtime include: ${ONNXRUNTIME_INCLUDE_DIR}")
message(STATUS "ONNX Runtime library: ${ONNXRUNTIME_LIB}")

# Include directories - THIS IS THE KEY FIX
include_directories(${LLVM_INCLUDE_DIRS})
include_directories(${ONNXRUNTIME_INCLUDE_DIR})
include_directories(${CMAKE_SOURCE_DIR}/include) # Add this line for your headers

# Add definitions
add_definitions(${LLVM_DEFINITIONS})

# Source files
set(SOURCES
src/main.cpp
src/GitHubFetcher.cpp
src/PRParser.cpp
src/ReviewerSuggester.cpp
src/BertTokenizer.cpp
)

# Header files (optional, for IDE support)
set(HEADERS
include/GitHubFetcher.h
include/PRParser.h
include/ReviewerSuggester.h
include/BertTokenizer.h
include/PRData.h # Add this line
)

# Create executable
add_executable(reviewer-suggester ${SOURCES} ${HEADERS})

# Link libraries
target_link_libraries(reviewer-suggester
${LLVM_LIBRARIES}
${CURL_LIBRARIES}
nlohmann_json::nlohmann_json
${ONNXRUNTIME_LIB}
)

# Set output directory
set_target_properties(reviewer-suggester PROPERTIES
RUNTIME_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/bin
)

# macOS specific settings
if(APPLE)
set_target_properties(reviewer-suggester PROPERTIES
MACOSX_RPATH TRUE
BUILD_RPATH "${ONNXRUNTIME_LIB}/.."
)
endif()
Loading