From: grumbel Date: Wed, 25 Nov 2009 16:52:20 +0000 (+0000) Subject: Miniswig build stuff X-Git-Url: https://git.verplant.org/?a=commitdiff_plain;h=50459126806385edf1974a29d4ace0f9b2856377;p=supertux.git Miniswig build stuff git-svn-id: http://supertux.lethargik.org/svn/supertux/trunk/supertux@6089 837edb03-e0f3-0310-88ca-d4d4e8b29345 --- diff --git a/SConscript b/SConscript index 69b425af2..e404d8757 100644 --- a/SConscript +++ b/SConscript @@ -14,6 +14,21 @@ # You should have received a copy of the GNU General Public License # along with this program. If not, see . + +development_cxx_flags =["-O2", "-g3", + "-ansi", + "-pedantic", + "-Wall", + "-Wextra", + "-Wnon-virtual-dtor", + "-Weffc++", + # "-Wconversion", + "-Werror", + # "-Wshadow", + "-Wcast-qual", + "-Winit-self", # only works with >= -O1 + "-Wno-unused-parameter"] + class Project: def __init__(self): self.build_squirrel() @@ -45,7 +60,9 @@ class Project: Glob("external/squirrel/sqstdlib/*.c")) def build_miniswig(self): - env = Environment(CPPPATH=[".", "tools/miniswig/"]) + cxx_flags = development_cxx_flags[:] + cxx_flags.remove("-Werror") + env = Environment(CXXFLAGS=cxx_flags, CPPPATH=[".", "tools/miniswig/"]) miniswig_bin = env.Program('miniswig', ['tools/miniswig/parser.yy', 'tools/miniswig/lexer.ll', @@ -55,18 +72,21 @@ class Project: 'tools/miniswig/main.cpp', 'tools/miniswig/tree.cpp']) - # env = self.env.Clone() - # env.Append(MINISWIG=miniswig_bin) - - # env.Depends(env.Command('src/scripting/miniswig.tmp', 'src/scripting/wrapper.interface.hpp', - # ["$CXX -E -Isrc/ -x c -CC $SOURCE -o $TARGET -DSCRIPTING_API"]), - # ['src/scripting/interface.hpp', - # 'src/scripting/game_objects.hpp']) - - # env.Depends(env.Command(['src/scripting/wrapper.cpp', 'src/scripting/wrapper.hpp'], 'src/scripting/miniswig.tmp', - # ["$MINISWIG --input $SOURCE --output-cpp ${TARGETS[0]} --output-hpp ${TARGETS[1]} "+ - # "--module windstille --select-namespace Scripting"]), - # miniswig_bin) + env.Append(MINISWIG=miniswig_bin) + env.Depends(env.Command('src/scripting/miniswig.tmp', + 'src/scripting/wrapper.interface.hpp', + ["$CXX -E -Isrc/ -x c -CC $SOURCE -o $TARGET -DSCRIPTING_API"]), + []) + + env.Depends(env.Command(['src/scripting/wrapper.cpp', 'src/scripting/wrapper.hpp'], + 'src/scripting/miniswig.tmp', + ["$MINISWIG " + + "--input $SOURCE " + + "--output-cpp ${TARGETS[0]} " + + "--output-hpp ${TARGETS[1]} " + + "--module supertux " + + "--select-namespace scripting"]), + miniswig_bin) # g++ -x "c++" -E -CC -DSCRIPTING_API src/scripting/wrapper.interface.hpp -o miniswig.tmp -Isrc # tools/miniswig/miniswig --input miniswig.tmp \ @@ -84,19 +104,7 @@ class Project: "src/", "/usr/include/AL/", # yuck "."], - CXXFLAGS=["-O2", "-g3", - "-ansi", - "-pedantic", - "-Wall", - "-Wextra", - "-Wnon-virtual-dtor", - "-Weffc++", - # "-Wconversion", - "-Werror", - # "-Wshadow", - "-Wcast-qual", - "-Winit-self", # only works with >= -O1 - "-Wno-unused-parameter"]) + CXXFLAGS=development_cxx_flags) # Add libraries self.env.ParseConfig("sdl-config --libs --cflags")