Skip to content

Commit d38110a

Browse files
committed
Use CMake variables instead of as
1 parent 23a7561 commit d38110a

File tree

1 file changed

+10
-4
lines changed

1 file changed

+10
-4
lines changed

cmake/system.cmake

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -106,10 +106,16 @@ if (CMAKE_C_COMPILER STREQUAL loongcc)
106106
endif ()
107107

108108
if (POWER)
109-
set (NO_WARMUP 1)
110-
execute_process(COMMAND bash -c "as -v < /dev/null 2>&1 | grep GNU 2>&1 >/dev/null" RESULT_VARIABLE HAVE_GAS)
111-
set(GETARCH_FLAGS "${GETARCH_FLAGS} -DHAVE_GAS=${HAVE_GAS}")
112-
endif()
109+
set(NO_WARMUP 1)
110+
set(HAVE_GAS 1)
111+
if (CMAKE_ASM_COMPILER_ID STREQUAL "GNU")
112+
set(HAVE_GAS 0)
113+
elseif (CMAKE_ASM_COMPILER_ID STREQUAL "Clang")
114+
set(CCOMMON_OPT "${CCOMMON_OPT} -fno-integrated-as")
115+
set(HAVE_GAS 0)
116+
endif ()
117+
set(GETARCH_FLAGS "${GETARCH_FLAGS} -DHAVE_GAS=${HAVE_GAS}")
118+
endif ()
113119

114120
#if don't use Fortran, it will only compile CBLAS.
115121
if (ONLY_CBLAS)

0 commit comments

Comments
 (0)