Skip to content

Commit

Permalink
XXX cmake function with arguments
Browse files Browse the repository at this point in the history
Next: Create a output messages file, and a C include file.

TODO: Name the generated files buildinfo-include.c and buildinfo-messages.txt
  • Loading branch information
ndim committed Nov 24, 2024
1 parent 9bdaa61 commit 6baf0b0
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 6 deletions.
13 changes: 7 additions & 6 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -368,8 +368,6 @@ endif()
# Configuration
# =====================================

buildinfo_output()

message(STATUS "Configuration summary:")
message(STATUS "----------------------")

Expand Down Expand Up @@ -406,11 +404,14 @@ if (DEBUG_CMAKE)
message(STATUS "----------------------")
endif()

buildinfo_item("libelf" "yes")
buildinfo_item("libelf" "no")
buildinfo_item("libelf" "DO HAVE")
buildinfo_item("libelf" "DON'T HAVE")

buildinfo_output()

if(HAVE_LIBELF)
buildinfo_item("libelf", "yes")
buildinfo_item("libelf", "no")
buildinfo_item("libelf", "DO HAVE")
buildinfo_item("libelf", "DON'T HAVE")
message(STATUS "DO HAVE libelf")
else()
message(STATUS "DON'T HAVE libelf")
Expand Down
7 changes: 7 additions & 0 deletions src/build-helpers/buildinfo.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,13 @@ function(buildinfo_setup)
message(STATUS "END buildinfo_setup")
endfunction()

function(buildinfo_item KEY VAL)
cmake_parse_arguments(arg "" "" "" ${ARGN})
message(STATUS "BEGIN buildinfo_item")
message(STATUS " K,V: ${KEY}, ${VAL}")
message(STATUS "END buildinfo_item")
endfunction()

function(buildinfo_output)
message(STATUS "BEGIN buildinfo_output")
message(STATUS "END buildinfo_output")
Expand Down

0 comments on commit 6baf0b0

Please sign in to comment.