File: hasMainSymbol.cmake

package info (click to toggle)
extra-cmake-modules 5.103.0-1
  • links: PTS, VCS
  • area: main
  • in suites: bookworm
  • size: 3,116 kB
  • sloc: python: 1,744; cpp: 646; ansic: 258; xml: 182; sh: 36; makefile: 5
file content (10 lines) | stat: -rw-r--r-- 364 bytes parent folder | download | duplicates (5)
1
2
3
4
5
6
7
8
9
10
execute_process(COMMAND nm --dynamic ${TARGET} ERROR_VARIABLE nm_errors OUTPUT_VARIABLE out RESULT_VARIABLE result)

if (NOT result EQUAL 0)
    message(FATAL_ERROR "nm failed on ${TARGET} exit(${result}): ${nm_errors}")
endif()

string(FIND ${out} " T main\n" found)
if(found LESS 0)
    message(FATAL_ERROR "Could not find a main() symbol on ${TARGET}")
endif()