Use CMake variables instead of as

This commit is contained in:
Rafael Cardoso Fernandes Sousa 2021-12-10 17:35:28 -06:00
parent 23a7561353
commit d38110a5ce
1 changed files with 10 additions and 4 deletions

View File

@ -107,7 +107,13 @@ endif ()
if (POWER)
set(NO_WARMUP 1)
execute_process(COMMAND bash -c "as -v < /dev/null 2>&1 | grep GNU 2>&1 >/dev/null" RESULT_VARIABLE HAVE_GAS)
set(HAVE_GAS 1)
if (CMAKE_ASM_COMPILER_ID STREQUAL "GNU")
set(HAVE_GAS 0)
elseif (CMAKE_ASM_COMPILER_ID STREQUAL "Clang")
set(CCOMMON_OPT "${CCOMMON_OPT} -fno-integrated-as")
set(HAVE_GAS 0)
endif ()
set(GETARCH_FLAGS "${GETARCH_FLAGS} -DHAVE_GAS=${HAVE_GAS}")
endif ()