Skip to content

Commit

Permalink
Add check
Browse files Browse the repository at this point in the history
  • Loading branch information
armallen committed Oct 4, 2023
1 parent 954e6ce commit 9d45a69
Showing 1 changed file with 15 additions and 0 deletions.
15 changes: 15 additions & 0 deletions CheckIec559.cmake
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
include(CheckCXXSourceCompiles)

function(check_cxx_double_is_iec559)
check_cxx_source_compiles("#include <limits>
int main() {
return std::numeric_limits<double>::is_iec559 ? 1 : 0;
}" IEC559_DOUBLE_SUPPORTED)

if(IEC559_DOUBLE_SUPPORTED)
message(STATUS "Compiler supports IEC 559 (IEEE 754) doubles.")
else()
message(FATAL_ERROR "Compiler does not support IEC 559 (IEEE 754) doubles.")
endif()
endfunction()

0 comments on commit 9d45a69

Please sign in to comment.