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

@ -106,10 +106,16 @@ if (CMAKE_C_COMPILER STREQUAL loongcc)
endif () endif ()
if (POWER) if (POWER)
set (NO_WARMUP 1) 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)
set(GETARCH_FLAGS "${GETARCH_FLAGS} -DHAVE_GAS=${HAVE_GAS}") if (CMAKE_ASM_COMPILER_ID STREQUAL "GNU")
endif() 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 ()
#if don't use Fortran, it will only compile CBLAS. #if don't use Fortran, it will only compile CBLAS.
if (ONLY_CBLAS) if (ONLY_CBLAS)