1 # Check if symbols are prefixed by an underscore in assembly language.
4 set(_conftest_c ${CMAKE_BINARY_DIR}/conftest.c)
5 set(_conftest_s ${CMAKE_BINARY_DIR}/conftest.s)
8 file(WRITE ${_conftest_c} "int foo() { return 0; }")
10 # CC='ccache gcc' => "${CMAKE_C_COMPILER_ARG1}" == " gcc"
11 # (notice the leading whitespace). Grrr!
12 string(STRIP "${CMAKE_C_COMPILER_ARG1}" _c_compiler_arg1)
14 COMMAND ${CMAKE_C_COMPILER} ${_c_compiler_arg1} -S ${_conftest_c}
15 RESULT_VARIABLE _cc_ret
17 if ("${_cc_ret}" EQUAL "0")
18 file(STRINGS ${_conftest_s} _asm_underscore REGEX "_foo")
20 set(ASM_UNDERSCORE true)
23 file(REMOVE ${_conftest_s} ${_conftest_c})