Skip to content

Commit

Permalink
Attempted fix for builds failing with compilers older than GCC 6
Browse files Browse the repository at this point in the history
  • Loading branch information
jyrkive committed Dec 22, 2016
1 parent 6c9ff7c commit 9ad7803
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
2 changes: 1 addition & 1 deletion CMakeLists.txt
Expand Up @@ -57,7 +57,7 @@ option(ENABLE_HISTORY "Enable using GNU history for history in lua console" ON)

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
OUTPUT_VARIABLE IEEE754_TEST_OUTPUT)
CMAKE_FLAGS "-DCXX_STANDARD=11" OUTPUT_VARIABLE IEEE754_TEST_OUTPUT)
if(NOT IEEE754_TEST_RETURN_CODE EQUAL 0)
message(${IEEE754_TEST_OUTPUT})
message(FATAL_ERROR "Your platform does not represent floating point numbers in the IEEE 754 format.")
Expand Down
8 changes: 4 additions & 4 deletions SConstruct
Expand Up @@ -319,6 +319,10 @@ if env["multilib_arch"]:
# Some tests need to load parts of boost
env.PrependENVPath('LD_LIBRARY_PATH', env["boostlibdir"])

# Some tests require at least C++11
env.AppendUnique(CCFLAGS = Split("-W -Wall"), CFLAGS = ["-std=c99"])
env.AppendUnique(CXXFLAGS = "-std=c++" + env["cxx_std"])

if env["prereqs"]:
conf = env.Configure(**configure_args)

Expand Down Expand Up @@ -463,10 +467,6 @@ for env in [test_env, client_env, env]:
env.Append(CPPDEFINES = ["HAVE_CONFIG_H"])

if "gcc" in env["TOOLS"]:
env.AppendUnique(CCFLAGS = Split("-W -Wall"), CFLAGS = ["-std=c99"])

env.AppendUnique(CXXFLAGS = "-std=c++" + env["cxx_std"])

if env['openmp']:
env.AppendUnique(CXXFLAGS = ["-fopenmp"], LIBS = ["gomp"])

Expand Down

1 comment on commit 9ad7803

@CelticMinstrel
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Seems to me that those appends should be within an if "gcc" in env["TOOLS"] check like they were before. Although the scons script doesn't appear to work with cl.exe or other compilers at the moment (unless I was doing something wrong when I tried it), there's no real reason to make the situation even worse.

Please sign in to comment.