Skip to content

Commit 4305fcc

Browse files
committed
cmake: generate clar.suite in binary directory
Change the output path of generate.py to generate the clar.suite file inside of the binary directory. This fixes out of tree builds with read-only source trees as we now refrain from writing anything into the source tree.
1 parent 8d22bce commit 4305fcc

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

CMakeLists.txt

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -676,15 +676,16 @@ IF (BUILD_CLAR)
676676
SET(SRC_CLAR "${CLAR_PATH}/main.c" "${CLAR_PATH}/clar_libgit2.c" "${CLAR_PATH}/clar_libgit2_trace.c" "${CLAR_PATH}/clar_libgit2_timer.c" "${CLAR_PATH}/clar.c")
677677

678678
ADD_CUSTOM_COMMAND(
679-
OUTPUT ${CLAR_PATH}/clar.suite
680-
COMMAND ${PYTHON_EXECUTABLE} generate.py -f -xonline -xstress .
679+
OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/clar.suite
680+
COMMAND ${PYTHON_EXECUTABLE} generate.py -o "${CMAKE_CURRENT_BINARY_DIR}" -f -xonline -xstress .
681681
DEPENDS ${SRC_TEST}
682682
WORKING_DIRECTORY ${CLAR_PATH}
683683
)
684+
INCLUDE_DIRECTORIES(${CMAKE_CURRENT_BINARY_DIR})
684685

685686
SET_SOURCE_FILES_PROPERTIES(
686687
${CLAR_PATH}/clar.c
687-
PROPERTIES OBJECT_DEPENDS ${CLAR_PATH}/clar.suite)
688+
PROPERTIES OBJECT_DEPENDS ${CMAKE_CURRENT_BINARY_DIR}/clar.suite)
688689

689690
ADD_EXECUTABLE(libgit2_clar ${SRC_H} ${SRC_GIT2} ${SRC_OS} ${SRC_CLAR} ${SRC_TEST} ${SRC_ZLIB} ${SRC_HTTP} ${SRC_REGEX} ${SRC_SSH} ${SRC_SHA1})
690691

0 commit comments

Comments
 (0)