diff --git a/SConstruct b/SConstruct index 27031a9..51e69ec 100644 --- a/SConstruct +++ b/SConstruct @@ -17,6 +17,7 @@ opts.AddVariables( ("RANLIB", "Archiver Indexer"), ("BUILDTYPE", "Build type (RELEASE, DEBUG, or PERF)", "RELEASE"), ("VERBOSE", "Show full build information (0 or 1)", "0"), + ("STRICT", "Strict error checking (0 or 1)", "0"), ("NUMCPUS", "Number of CPUs to use for build (0 means auto).", "0"), ("WITH_GPROF", "Include gprof profiling (0 or 1).", "0"), ("PREFIX", "Installation target directory.", "#pxelinux"), @@ -59,8 +60,11 @@ env.Append(CFLAGS = [ "-Wshadow", "-Wno-typedef-redefinition" ]) #env.Append(CXXFLAGS = [ "-Wno-non-template-friend", "-Woverloaded-virtual", # "-Wcast-qual", "-Wcast-align", "-Wconversion", # "-Weffc++", "-std=c++0x", "-Werror" ]) -env.Append(CPPFLAGS = [ "-fno-builtin", "-fno-stack-protector", - "-Wformat=2", "-Wmissing-format-attribute" ]) +env.Append(CPPFLAGS = [ "-fno-builtin", "-fno-stack-protector" ]) + +if (env["STRICT"] == "1"): + env.Append(CPPFLAGS = [ "-Wformat=2", "-Wmissing-format-attribute", + "-Wthread-safety", "-Wwrite-strings" ]) if env["WITH_GPROF"] == "1": env.Append(CPPFLAGS = [ "-pg" ])