scons script to cross-compile wesnoth for windows
This commit is contained in:
parent
da8b733106
commit
b77c9ffaa7
1 changed files with 37 additions and 0 deletions
37
utils/SConstruct
Normal file
37
utils/SConstruct
Normal file
|
@ -0,0 +1,37 @@
|
|||
# vi: syntax=python
|
||||
import glob
|
||||
|
||||
sources = glob.glob("src/*.cpp") + glob.glob("src/widgets/*.cpp") +\
|
||||
glob.glob("src/serialization/*.cpp") + glob.glob("src/sdl_ttf/*.c")
|
||||
sources.remove("src/loadscreen_empty.cpp")
|
||||
|
||||
env = Environment()
|
||||
|
||||
# The cross compiler to use
|
||||
env["CC"] = "i586-mingw32msvc-gcc"
|
||||
env["CXX"] = "i586-mingw32msvc-g++"
|
||||
|
||||
# Dependencies: SDL, SDL_net, SDL_mixer, SDL_image, freetype, libintl
|
||||
# This is where I put the dependency headers
|
||||
env.Append(CPPPATH = ["../win-deps/include"])
|
||||
|
||||
# This is where I put the dependency libs
|
||||
env.Append(LIBPATH = ["../win-deps/lib"])
|
||||
|
||||
# Compilation settings
|
||||
env.Append(CCFLAGS = ["-O2", "-mthreads"])
|
||||
env.Append(LINKFLAGS = ["-s", "-mwindows", "-lmingwthrd"])
|
||||
env.Append(CPPPATH = ["src", "src/widgets"])
|
||||
env.Append(LIBS = ["mingw32", "SDLmain", "SDL", "SDL_net", "SDL_mixer", "SDL_image",
|
||||
"intl", "wsock32", "freetype"])
|
||||
|
||||
# Scons stuff
|
||||
env.BuildDir("../build", "src")
|
||||
env.SConsignFile("sconsign")
|
||||
|
||||
# Windows stuff
|
||||
env["PROGSUFFIX"] = ".exe"
|
||||
|
||||
# Compile it!
|
||||
env.Program("wesnoth", ["../build/" + x[4:] for x in sources])
|
||||
|
Loading…
Add table
Reference in a new issue