diff options
author | Chris Robinson <[email protected]> | 2016-01-21 21:51:20 -0800 |
---|---|---|
committer | Chris Robinson <[email protected]> | 2016-01-21 21:51:20 -0800 |
commit | 87b6c30932d66228af4774d6e65bdea3d9895514 (patch) | |
tree | 5e198adb3eab6b21b8c622270033960622470249 /CMakeLists.txt | |
parent | fb599b5b83f8c6926d2c30a18fa093d14ea087a2 (diff) |
Reorder some cmake checks
Diffstat (limited to 'CMakeLists.txt')
-rw-r--r-- | CMakeLists.txt | 39 |
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) |