Skip to content

Commit

Permalink
Merge pull request #7109 from keithc-ca/cmake
Browse files Browse the repository at this point in the history
Avoid cmake policy CMP0140 warnings
  • Loading branch information
babsingh authored Sep 6, 2023
2 parents 873ac5d + 5efa446 commit 612cde0
Showing 1 changed file with 3 additions and 6 deletions.
9 changes: 3 additions & 6 deletions cmake/modules/ddr/GenerateStub.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -47,10 +47,9 @@ endmacro()
file(WRITE "${output_file}" "/* generated file, DO NOT EDIT */\nconst char ddr_source[] = \"${input_file}\";\n")

execute_process(COMMAND grep -E -q "@ddr_(namespace|options):" ${input_file} RESULT_VARIABLE rc)
if(NOT rc EQUAL 0)
# input doesn't have any DDR directives, so leave the file (mostly) empty
set(rc 0)
else()

# Leave the output mostly empty if the input doesn't have any DDR directives.
if(rc EQUAL 0)
execute_process(COMMAND awk -f ${AWK_SCRIPT} ${input_file} OUTPUT_VARIABLE awk_result RESULT_VARIABLE rc)

if(NOT rc EQUAL 0)
Expand All @@ -67,5 +66,3 @@ else()
file(APPEND ${output_file} "${awk_result}")
endif()
endif()

return(${rc})

0 comments on commit 612cde0

Please sign in to comment.