Skip to content

Commit 6baf0b0

Browse files
committed
XXX cmake function with arguments
Next: Create a output messages file, and a C include file. TODO: Name the generated files buildinfo-include.c and buildinfo-messages.txt
1 parent 9bdaa61 commit 6baf0b0

File tree

2 files changed

+14
-6
lines changed

2 files changed

+14
-6
lines changed

CMakeLists.txt

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -368,8 +368,6 @@ endif()
368368
# Configuration
369369
# =====================================
370370

371-
buildinfo_output()
372-
373371
message(STATUS "Configuration summary:")
374372
message(STATUS "----------------------")
375373

@@ -406,11 +404,14 @@ if (DEBUG_CMAKE)
406404
message(STATUS "----------------------")
407405
endif()
408406

407+
buildinfo_item("libelf" "yes")
408+
buildinfo_item("libelf" "no")
409+
buildinfo_item("libelf" "DO HAVE")
410+
buildinfo_item("libelf" "DON'T HAVE")
411+
412+
buildinfo_output()
413+
409414
if(HAVE_LIBELF)
410-
buildinfo_item("libelf", "yes")
411-
buildinfo_item("libelf", "no")
412-
buildinfo_item("libelf", "DO HAVE")
413-
buildinfo_item("libelf", "DON'T HAVE")
414415
message(STATUS "DO HAVE libelf")
415416
else()
416417
message(STATUS "DON'T HAVE libelf")

src/build-helpers/buildinfo.cmake

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,13 @@ function(buildinfo_setup)
33
message(STATUS "END buildinfo_setup")
44
endfunction()
55

6+
function(buildinfo_item KEY VAL)
7+
cmake_parse_arguments(arg "" "" "" ${ARGN})
8+
message(STATUS "BEGIN buildinfo_item")
9+
message(STATUS " K,V: ${KEY}, ${VAL}")
10+
message(STATUS "END buildinfo_item")
11+
endfunction()
12+
613
function(buildinfo_output)
714
message(STATUS "BEGIN buildinfo_output")
815
message(STATUS "END buildinfo_output")

0 commit comments

Comments
 (0)