Skip to content

Commit

Permalink
Fix tagtbl.C placement in build dir
Browse files Browse the repository at this point in the history
The COMMAND for tagtbl.C generation dumps the file in the top-level
build directory whereas the OUTPUT is specified in the current (lib/)
directory.  This leads to unnecessary relinking of all the libraries on
each make invocation because OUTPUT is always missing.

Fix this by outputting the file in the current directory where OUTPUT
can find it.

No functional change, just makes rebuilds quicker.
  • Loading branch information
dmnks committed Sep 18, 2023
1 parent 9c96c5d commit eed84b1
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion lib/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ target_compile_definitions(librpm PRIVATE
target_include_directories(librpm PRIVATE
${CMAKE_CURRENT_SOURCE_DIR}
${CMAKE_SOURCE_DIR}/rpmio
${CMAKE_CURRENT_BINARY_DIR}
)

target_sources(librpm PRIVATE
Expand Down Expand Up @@ -66,7 +67,7 @@ if(WITH_CAP)
endif()

add_custom_command(OUTPUT tagtbl.C
COMMAND AWK=gawk ${CMAKE_CURRENT_SOURCE_DIR}/gentagtbl.sh ${CMAKE_SOURCE_DIR}/include/rpm/rpmtag.h > ${CMAKE_BINARY_DIR}/tagtbl.C
COMMAND AWK=gawk ${CMAKE_CURRENT_SOURCE_DIR}/gentagtbl.sh ${CMAKE_SOURCE_DIR}/include/rpm/rpmtag.h > tagtbl.C
DEPENDS ${CMAKE_SOURCE_DIR}/include/rpm/rpmtag.h gentagtbl.sh
)

Expand Down

0 comments on commit eed84b1

Please sign in to comment.