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
6 changes: 5 additions & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,6 +1,10 @@
cmake_minimum_required(VERSION 3.11)

project(ArgumentManagerProject VERSION 1.0 LANGUAGES CXX)
project(ArgumentManagerProject VERSION 1.0 LANGUAGES C CXX)

include(${CMAKE_SOURCE_DIR}/cmake/CheckLLVMVersion.cmake)
set(LLVM_MIN_REQUIRED_VERSION "19" CACHE STRING "Minimum required LLVM version")
check_llvm_version(${LLVM_MIN_REQUIRED_VERSION})

set(CMAKE_CXX_STANDARD 20)
set(CMAKE_CXX_STANDARD_REQUIRED ON)
Expand Down
6 changes: 5 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,8 @@ Depending on your configuration, you can pass these parameters to cmake. The par
cmake .. \
-DPARSER_TYPE=CLI11 \
-DUSE_THREAD_SANITIZER=ON \
-DUSE_ADDRESS_SANITIZER=OFF
-DUSE_ADDRESS_SANITIZER=OFF \
-DLLVM_DIR=your/llvm/version
```

```bash
Expand Down Expand Up @@ -54,6 +55,9 @@ Options:
--invoke <tools> Invokes specific tools (comma-separated).
Available tools: flawfinder, ikos, cppcheck, tscancode.
--input <files> Specifies the source files to analyse (comma-separated).
--ipc <method> Specifies the IPC method to use (e.g., fifo, socket).
--ipc-path <path> Specifies the IPC path (default: /tmp/coretrace_ipc).
--async Enables asynchronous execution.

Examples:
ctrace --input main.cpp,util.cpp --static --invoke=cppcheck,flawfinder
Expand Down
13 changes: 13 additions & 0 deletions cmake/CheckLLVMVersion.cmake
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
# cmake/CheckLLVMVersion.cmake
function(check_llvm_version MIN_REQUIRED)
message(STATUS "Checking for LLVM >= ${MIN_REQUIRED}...")
find_package(LLVM REQUIRED CONFIG)

if (LLVM_PACKAGE_VERSION VERSION_LESS ${MIN_REQUIRED})
message(FATAL_ERROR
"LLVM version ${LLVM_PACKAGE_VERSION} found, but version ${MIN_REQUIRED} or higher is required."
)
else()
message(STATUS "Found LLVM ${LLVM_PACKAGE_VERSION}")
endif()
endfunction()
Loading