Build: Set FLOATTEST* by default for AArch64, PPC
Because of 47656a0820, we can now
reliably determine the correct default values for FLOATTEST8 and
FLOATTEST12 when using Clang or GCC to build for AArch64 or PowerPC
platforms. (Testing confirms that this is the case with GCC 5-13 and
Clang 5-14 on Ubuntu/AArch64, GCC 4 on CentOS 7/PPC, and GCC 8-10 and
Clang 6-12 on Ubuntu/PPCLE.) Other CPU architectures and compilers can
be added on a case-by-case basis as they are tested.
This commit is contained in:
@@ -894,6 +894,17 @@ if(CPU_TYPE STREQUAL "x86_64" OR CPU_TYPE STREQUAL "i386")
|
||||
elseif(CPU_TYPE STREQUAL "x86_64")
|
||||
set(DEFAULT_FLOATTEST8 no-fp-contract)
|
||||
endif()
|
||||
elseif(CPU_TYPE STREQUAL "powerpc" OR CPU_TYPE STREQUAL "arm64")
|
||||
if(CMAKE_C_COMPILER_ID STREQUAL "Clang")
|
||||
if(CMAKE_C_COMPILER_VERSION VERSION_EQUAL 14.0.0 OR
|
||||
CMAKE_C_COMPILER_VERSION VERSION_GREATER 14.0.0)
|
||||
set(DEFAULT_FLOATTEST8 fp-contract)
|
||||
else()
|
||||
set(DEFAULT_FLOATTEST8 no-fp-contract)
|
||||
endif()
|
||||
elseif(CMAKE_COMPILER_IS_GNUCC)
|
||||
set(DEFAULT_FLOATTEST8 fp-contract)
|
||||
endif()
|
||||
# else we can't really set an intelligent default for FLOATTEST8. The
|
||||
# appropriate value could be no-fp-contract, fp-contract, 387, or msvc,
|
||||
# depending on the compiler and compiler options. We leave it to the user to
|
||||
@@ -925,6 +936,17 @@ endif()
|
||||
|
||||
if(CPU_TYPE STREQUAL "x86_64")
|
||||
set(DEFAULT_FLOATTEST12 no-fp-contract)
|
||||
elseif(CPU_TYPE STREQUAL "powerpc" OR CPU_TYPE STREQUAL "arm64")
|
||||
if(CMAKE_C_COMPILER_ID STREQUAL "Clang")
|
||||
if(CMAKE_C_COMPILER_VERSION VERSION_EQUAL 14.0.0 OR
|
||||
CMAKE_C_COMPILER_VERSION VERSION_GREATER 14.0.0)
|
||||
set(DEFAULT_FLOATTEST12 fp-contract)
|
||||
else()
|
||||
set(DEFAULT_FLOATTEST12 no-fp-contract)
|
||||
endif()
|
||||
elseif(CMAKE_COMPILER_IS_GNUCC)
|
||||
set(DEFAULT_FLOATTEST12 fp-contract)
|
||||
endif()
|
||||
# else we can't really set an intelligent default for FLOATTEST12. The
|
||||
# appropriate value could be no-fp-contract, fp-contract, or something else,
|
||||
# depending on the compiler and compiler options. We leave it to the user to
|
||||
|
||||
Reference in New Issue
Block a user