Skip to content

Commit

Permalink
SCons version of commit 7968f7b
Browse files Browse the repository at this point in the history
  • Loading branch information
jyrkive committed Dec 22, 2016
1 parent 7968f7b commit 5fc50bf
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 1 deletion.
10 changes: 9 additions & 1 deletion SConstruct
Expand Up @@ -306,7 +306,7 @@ def Warning(message):

from metasconf import init_metasconf
configure_args = dict(
custom_tests = init_metasconf(env, ["cplusplus", "python_devel", "sdl", "boost", "pango", "pkgconfig", "gettext", "lua"]),
custom_tests = init_metasconf(env, ["ieee_754", "cplusplus", "python_devel", "sdl", "boost", "pango", "pkgconfig", "gettext", "lua"]),
config_h = "$build_dir/config.h",
log_file="$build_dir/config.log", conf_dir="$build_dir/sconf_temp")

Expand All @@ -331,6 +331,13 @@ 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"])
Expand All @@ -349,6 +356,7 @@ if env["prereqs"]:
conf.CheckSDL("SDL2_image", header_file = "SDL_image")

have_server_prereqs = (\
CheckIEEE754(conf) & \
conf.CheckCPlusPlus(gcc_version = "4.8") & \
conf.CheckBoost("iostreams", require_version = boost_version) & \
conf.CheckBoostIostreamsGZip() & \
Expand Down
10 changes: 10 additions & 0 deletions scons/ieee_754.py
@@ -0,0 +1,10 @@
import os.path

def CheckIEEE754(context):
context.Message("Checking if floating point numbers are in the IEEE 754 format... ")
test_file = open(os.path.join("src", "compile_time_tests", "ieee_754.cpp"))
ret, _ = context.TryRun(test_file.read(), ".cpp")
context.Result(ret)
return ret

config_checks = { "CheckIEEE754" : CheckIEEE754 }

0 comments on commit 5fc50bf

Please sign in to comment.