From 930cda39cd95ec19c42a32f2a18fbbe95667952d Mon Sep 17 00:00:00 2001 From: Chris Robinson Date: Tue, 14 Apr 2020 22:02:59 -0700 Subject: Simplify some indentation --- CMakeLists.txt | 47 ++++++++++++++++++++++------------------------- 1 file changed, 22 insertions(+), 25 deletions(-) (limited to 'CMakeLists.txt') diff --git a/CMakeLists.txt b/CMakeLists.txt index 760e0e6f..567ea55b 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -328,31 +328,28 @@ CHECK_INCLUDE_FILE(pmmintrin.h HAVE_PMMINTRIN_H "${SSE3_SWITCH}") CHECK_INCLUDE_FILE(smmintrin.h HAVE_SMMINTRIN_H "${SSE4_1_SWITCH}") CHECK_INCLUDE_FILE(arm_neon.h HAVE_ARM_NEON_H "${FPU_NEON_SWITCH}") -SET(SSE_FLAGS ) -SET(FPMATH_SET "0") -IF(CMAKE_SIZEOF_VOID_P MATCHES "4") - IF(SSE2_SWITCH OR MSVC) - OPTION(ALSOFT_ENABLE_SSE2_CODEGEN "Enable SSE2 code generation instead of x87 for 32-bit targets." TRUE) - ENDIF() - - IF(ALSOFT_ENABLE_SSE2_CODEGEN) - IF(SSE2_SWITCH) - CHECK_C_COMPILER_FLAG("${SSE2_SWITCH} -mfpmath=sse" HAVE_MFPMATH_SSE_2) - IF(HAVE_MFPMATH_SSE_2) - SET(SSE_FLAGS ${SSE_FLAGS} ${SSE2_SWITCH} -mfpmath=sse) - SET(C_FLAGS ${C_FLAGS} ${SSE_FLAGS}) - SET(FPMATH_SET 2) - ENDIF() - ELSEIF(MSVC) - CHECK_C_COMPILER_FLAG("/arch:SSE2" HAVE_ARCH_SSE2) - IF(HAVE_ARCH_SSE2) - SET(SSE_FLAGS ${SSE_FLAGS} "/arch:SSE2") - SET(C_FLAGS ${C_FLAGS} ${SSE_FLAGS}) - SET(FPMATH_SET 2) - ENDIF() - ENDIF() - ENDIF() -ENDIF() +set(SSE_FLAGS ) +set(FPMATH_SET "0") +if(CMAKE_SIZEOF_VOID_P MATCHES "4" AND (SSE2_SWITCH OR MSVC)) + option(ALSOFT_ENABLE_SSE2_CODEGEN "Enable SSE2 code generation instead of x87 for 32-bit targets." TRUE) + if(ALSOFT_ENABLE_SSE2_CODEGEN) + if(SSE2_SWITCH) + check_c_compiler_flag("${SSE2_SWITCH} -mfpmath=sse" HAVE_MFPMATH_SSE_2) + if(HAVE_MFPMATH_SSE_2) + set(SSE_FLAGS ${SSE_FLAGS} ${SSE2_SWITCH} -mfpmath=sse) + set(C_FLAGS ${C_FLAGS} ${SSE_FLAGS}) + set(FPMATH_SET 2) + endif() + elseif(MSVC) + check_c_compiler_flag("/arch:SSE2" HAVE_ARCH_SSE2) + if(HAVE_ARCH_SSE2) + set(SSE_FLAGS ${SSE_FLAGS} "/arch:SSE2") + set(C_FLAGS ${C_FLAGS} ${SSE_FLAGS}) + set(FPMATH_SET 2) + endif() + endif() + endif() +endif() IF(HAVE_EMMINTRIN_H) SET(OLD_REQUIRED_FLAGS ${CMAKE_REQUIRED_FLAGS}) -- cgit v1.2.3