aboutsummaryrefslogtreecommitdiffstats
path: root/ConfigureChecks.cmake
diff options
context:
space:
mode:
authorTsuda Kageyu <tsuda.kageyu@gmail.com>2014-07-17 01:28:02 +0900
committerTsuda Kageyu <tsuda.kageyu@gmail.com>2014-07-17 12:09:14 +0900
commite29f1d39e7695ebff50e490f4f3155f229121a32 (patch)
treef27236a71185b1983c06fa1b890dd278d9eb6ee3 /ConfigureChecks.cmake
parentb509106031e6ae3675ad9601e5ae8bf5f3844109 (diff)
Added float conversion functions to ByteVector.
Added CMake checks about IEEE754 compliance.
Diffstat (limited to 'ConfigureChecks.cmake')
-rw-r--r--ConfigureChecks.cmake25
1 files changed, 24 insertions, 1 deletions
diff --git a/ConfigureChecks.cmake b/ConfigureChecks.cmake
index f2d4cae0..23830f93 100644
--- a/ConfigureChecks.cmake
+++ b/ConfigureChecks.cmake
@@ -6,8 +6,9 @@ include(CheckLibraryExists)
include(CheckTypeSize)
include(CheckCXXSourceCompiles)
include(TestBigEndian)
+include(TestFloatFormat)
-# Check if the size of integral types are suitable.
+# Check if the size of numeric types are suitable.
check_type_size("short" SIZEOF_SHORT)
if(NOT ${SIZEOF_SHORT} EQUAL 2)
@@ -29,6 +30,16 @@ if(${SIZEOF_WCHAR_T} LESS 2)
MESSAGE(FATAL_ERROR "TagLib requires that wchar_t is sufficient to store a UTF-16 char.")
endif()
+check_type_size("float" SIZEOF_FLOAT)
+if(NOT ${SIZEOF_FLOAT} EQUAL 4)
+ MESSAGE(FATAL_ERROR "TagLib requires that float is 32-bit wide.")
+endif()
+
+check_type_size("double" SIZEOF_DOUBLE)
+if(NOT ${SIZEOF_DOUBLE} EQUAL 8)
+ MESSAGE(FATAL_ERROR "TagLib requires that double is 64-bit wide.")
+endif()
+
# Determine the CPU byte order.
test_big_endian(IS_BIG_ENDIAN)
@@ -39,6 +50,18 @@ else()
set(SYSTEM_BYTEORDER 2)
endif()
+# Check if the format of floating point types are suitable.
+
+test_float_format(FP_IEEE754)
+if(${FP_IEEE754} EQUAL 1)
+ set(FLOAT_BYTEORDER 1)
+elseif(${FP_IEEE754} EQUAL 2)
+ set(FLOAT_BYTEORDER 2)
+else()
+ MESSAGE(FATAL_ERROR "TagLib requires that floating point types are IEEE754 compliant.")
+endif()
+
+
# Determine which kind of atomic operations your compiler supports.
check_cxx_source_compiles("