Add STRICT compile flag.

This commit is contained in:
Ali Mashtizadeh 2023-08-30 12:58:14 -04:00
parent 52377a980c
commit cbf5643974

View File

@ -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" ])