Remove the CMake/Scons compile-time check for IEEE 754 compliance

Now handled by a static assertion.
This commit is contained in:
Charles Dang 2018-05-21 14:38:16 +11:00
parent 6eddc6f978
commit d9315199ee
4 changed files with 1 additions and 44 deletions

View file

@ -63,19 +63,6 @@ if(NOT CXX_STD)
set(CXX_STD "14")
endif()
if(NOT CMAKE_CROSSCOMPILING)
try_run(IEEE754_TEST_RETURN_CODE IEEE754_TEST_COMPILED ${CMAKE_BINARY_DIR} ${CMAKE_SOURCE_DIR}/src/compile_time_tests/ieee_754.cpp
CMAKE_FLAGS "-DCMAKE_CXX_STANDARD=${CXX_STD}" COMPILE_OUTPUT_VARIABLE IEEE754_TEST_COMPILE_OUTPUT)
if(NOT IEEE754_TEST_COMPILED)
message(WARNING "Failed to compile the IEEE 754 test. Skipping it.")
message(${IEEE754_TEST_COMPILE_OUTPUT})
elseif(NOT IEEE754_TEST_RETURN_CODE EQUAL 0)
message(FATAL_ERROR "Your platform does not represent floating point numbers in the IEEE 754 format.")
endif()
else()
message(WARNING "You are cross-compiling. Skipping IEEE 754 test.")
endif()
if(ENABLE_GAME OR ENABLE_TESTS)
find_package(OpenGL REQUIRED)
find_package(GLEW REQUIRED)

View file

@ -308,7 +308,7 @@ def Warning(message):
from metasconf import init_metasconf
configure_args = dict(
custom_tests = init_metasconf(env, ["ieee_754", "cplusplus", "python_devel", "sdl", "boost", "cairo", "pango", "pkgconfig", "gettext_tool", "lua", "gl"]),
custom_tests = init_metasconf(env, ["cplusplus", "python_devel", "sdl", "boost", "cairo", "pango", "pkgconfig", "gettext_tool", "lua", "gl"]),
config_h = "$build_dir/config.h",
log_file="$build_dir/config.log", conf_dir="$build_dir/sconf_temp")
@ -338,13 +338,6 @@ if env["prereqs"]:
conf.CheckLib("m")
conf.CheckFunc("round")
def CheckIEEE754(conf):
if not env["host"]:
return conf.CheckIEEE754()
else:
Warning("You are cross-compiling. Skipping IEEE 754 test.")
return True
def CheckAsio(conf):
if env["PLATFORM"] == 'win32':
conf.env.Append(LIBS = ["libws2_32"])
@ -362,7 +355,6 @@ if env["prereqs"]:
conf.CheckSDL("SDL2_image", header_file = "SDL_image")
have_server_prereqs = (\
CheckIEEE754(conf) & \
conf.CheckCPlusPlus(gcc_version = "4.8") & \
conf.CheckLib("libcrypto") & \
conf.CheckBoost("iostreams", require_version = boost_version) & \

View file

@ -1,11 +0,0 @@
import os.path
from SCons.Script import File
def CheckIEEE754(context):
context.Message("Checking if floating point numbers are in the IEEE 754 format... ")
test_file = File(os.path.join("src", "compile_time_tests", "ieee_754.cpp")).get_contents().decode("utf-8")
ret, _ = context.TryRun(test_file, ".cpp")
context.Result(ret)
return ret
config_checks = { "CheckIEEE754" : CheckIEEE754 }

View file

@ -1,11 +0,0 @@
#include <limits>
// This test verifies that floating point numbers are represented in the IEEE 754 format.
// Wesnoth requires that.
int main()
{
// Return code zero means success.
// Thus, check that the bit representation is *not* what IEEE 754 specifies.
bool match = std::numeric_limits<double>::is_iec559;
return !match;
}