Skip to content

Commit

Permalink
d
Browse files Browse the repository at this point in the history
  • Loading branch information
anthonymakarewicz committed Jul 15, 2024
1 parent a353c51 commit 0d79839
Show file tree
Hide file tree
Showing 26 changed files with 61 additions and 2,064 deletions.
5 changes: 3 additions & 2 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ jobs:
rm -rf build
mkdir build
cd build
cmake -DCMAKE_CXX_STANDARD=2b ..
cmake -DCMAKE_CXX_STANDARD=20 ..
- name: Build Main Executable and Test Executable
run: |
Expand All @@ -35,7 +35,8 @@ jobs:
cd build
make clean # Ensure a clean build to run clang-tidy on all files
cmake -DCMAKE_EXPORT_COMPILE_COMMANDS=ON ..
clang-tidy -p .
run-clang-tidy-10 -p
# clang-tidy -p .

#- name: Check code formatting with clang-format
# run: |
Expand Down
17 changes: 10 additions & 7 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
cmake_minimum_required(VERSION 3.26.3)
project(Option_pricer)

# Set the version of C++ to 23 (using the alias c++2b for compatibility with clang-tidy)
set(CMAKE_CXX_STANDARD 23)
# Set the version of C++ to 20
set(CMAKE_CXX_STANDARD 20)
set(CMAKE_CXX_STANDARD_REQUIRED ON)
set(CMAKE_CXX_EXTENSIONS OFF)

Expand All @@ -20,15 +20,18 @@ enable_testing()
add_subdirectory(tests)

# clang-tidy integration
set(CMAKE_CXX_CLANG_TIDY "clang-tidy;-checks=*,-clang-analyzer-alpha.*")
find_program(CLANG_TIDY_EXECUTABLE NAMES clang-tidy)
if(CLANG_TIDY_EXECUTABLE)
set(CMAKE_CXX_CLANG_TIDY "${CLANG_TIDY_EXECUTABLE};-checks=*,-clang-analyzer-alpha.*")
endif()

# clang-format integration (target to check formatting)
#add_custom_target(clang-format-check
# COMMAND find ${CMAKE_SOURCE_DIR} -name '*.cpp' -o -name '*.h' | xargs clang-format -i
#)

# Code coverage integration (optional)
if (CMAKE_BUILD_TYPE STREQUAL "Coverage")
target_compile_options(Option_pricer PRIVATE --coverage)
target_link_libraries(Option_pricer PRIVATE --coverage)
endif()
#if (CMAKE_BUILD_TYPE STREQUAL "Coverage")
# target_compile_options(Option_pricer PRIVATE --coverage)
# target_link_libraries(Option_pricer PRIVATE --coverage)
#endif()
Loading

0 comments on commit 0d79839

Please sign in to comment.