aboutsummaryrefslogtreecommitdiffstats
path: root/CMakeLists.txt
diff options
context:
space:
mode:
Diffstat (limited to 'CMakeLists.txt')
-rw-r--r--CMakeLists.txt39
1 files changed, 19 insertions, 20 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt
index d3b35c2f..1ce10be7 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -398,6 +398,25 @@ IF(NOT HAVE_GUIDDEF_H)
CHECK_INCLUDE_FILE(initguid.h HAVE_INITGUID_H)
ENDIF()
+# Some systems need libm for some of the following math functions to work
+CHECK_LIBRARY_EXISTS(m pow "" HAVE_LIBM)
+IF(HAVE_LIBM)
+ SET(EXTRA_LIBS m ${EXTRA_LIBS})
+ SET(CMAKE_REQUIRED_LIBRARIES ${CMAKE_REQUIRED_LIBRARIES} m)
+ENDIF()
+
+# Check for the dlopen API (for dynamicly loading backend libs)
+IF(ALSOFT_DLOPEN)
+ CHECK_LIBRARY_EXISTS(dl dlopen "" HAVE_LIBDL)
+ IF(HAVE_LIBDL)
+ SET(EXTRA_LIBS dl ${EXTRA_LIBS})
+ SET(CMAKE_REQUIRED_LIBRARIES ${CMAKE_REQUIRED_LIBRARIES} dl)
+ ENDIF()
+
+ CHECK_INCLUDE_FILE(dlfcn.h HAVE_DLFCN_H)
+ENDIF()
+
+# Check for a cpuid intrinsic
IF(HAVE_CPUID_H)
CHECK_C_SOURCE_COMPILES("#include <cpuid.h>
int main()
@@ -406,7 +425,6 @@ IF(HAVE_CPUID_H)
return __get_cpuid(0, &eax, &ebx, &ecx, &edx);
}" HAVE_GCC_GET_CPUID)
ENDIF()
-
IF(HAVE_INTRIN_H)
CHECK_C_SOURCE_COMPILES("#include <intrin.h>
int main()
@@ -417,14 +435,6 @@ IF(HAVE_INTRIN_H)
}" HAVE_CPUID_INTRINSIC)
ENDIF()
-# Some systems need libm for some of the following math functions to work
-CHECK_LIBRARY_EXISTS(m pow "" HAVE_LIBM)
-IF(HAVE_LIBM)
- SET(EXTRA_LIBS m ${EXTRA_LIBS})
- SET(CMAKE_REQUIRED_LIBRARIES ${CMAKE_REQUIRED_LIBRARIES} m)
-ENDIF()
-
-
CHECK_SYMBOL_EXISTS(aligned_alloc stdlib.h HAVE_ALIGNED_ALLOC)
CHECK_SYMBOL_EXISTS(posix_memalign stdlib.h HAVE_POSIX_MEMALIGN)
CHECK_SYMBOL_EXISTS(_aligned_malloc malloc.h HAVE__ALIGNED_MALLOC)
@@ -500,17 +510,6 @@ IF(NOT HAVE_ISNAN)
ENDIF()
-# Check for the dlopen API (for dynamicly loading backend libs)
-IF(ALSOFT_DLOPEN)
- CHECK_INCLUDE_FILE(dlfcn.h HAVE_DLFCN_H)
- IF(HAVE_DLFCN_H)
- CHECK_LIBRARY_EXISTS(dl dlopen "" HAVE_LIBDL)
- IF(HAVE_LIBDL)
- SET(EXTRA_LIBS dl ${EXTRA_LIBS})
- ENDIF()
- ENDIF()
-ENDIF()
-
# Check if we have Windows headers
CHECK_INCLUDE_FILE(windows.h HAVE_WINDOWS_H -D_WIN32_WINNT=0x0502)
IF(NOT HAVE_WINDOWS_H)