Skip to content

Commit add16b1

Browse files
committed
only copy ompile_commands.json when it exist
1 parent 9f5fee0 commit add16b1

File tree

2 files changed

+5
-2
lines changed

2 files changed

+5
-2
lines changed

Diff for: testing/CMakeLists.txt

+4-2
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
cmake_minimum_required(VERSION 3.15)
1+
cmake_minimum_required(VERSION 3.21)
22

33
# Set the project name to your project name
44
project(main C CXX)
@@ -10,4 +10,6 @@ add_executable(main
1010
)
1111
target_include_directories(main PUBLIC ${CMAKE_CURRENT_SOURCE_DIR})
1212

13-
file(COPY ${CMAKE_CURRENT_BINARY_DIR}/compile_commands.json DESTINATION "${CMAKE_CURRENT_SOURCE_DIR}")
13+
if(EXISTS ${CMAKE_CURRENT_BINARY_DIR}/compile_commands.json)
14+
file(COPY ${CMAKE_CURRENT_BINARY_DIR}/compile_commands.json DESTINATION ${CMAKE_CURRENT_SOURCE_DIR})
15+
endif()

Diff for: tests/test_clang_tidy.py

+1
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ def generate_compilation_database():
1010
# Generate compilation database
1111
subprocess.run(['mkdir', '-p', 'build'])
1212
subprocess.run(['cmake', '-Bbuild', 'testing/'])
13+
subprocess.run(['cmake', '-Bbuild', 'testing/'])
1314

1415

1516
@pytest.mark.parametrize(

0 commit comments

Comments
 (0)