clear sdl2-image when building sdl2, and improve logging

This commit is contained in:
Alon Zakai 2014-10-22 11:11:06 -07:00
Родитель 3ab16c70ef
Коммит eb2b151090
3 изменённых файлов: 12 добавлений и 6 удалений

Просмотреть файл

@ -1,4 +1,4 @@
import os, shutil
import os, shutil, logging
VERSION = 1
@ -22,6 +22,9 @@ def get(ports, settings, shared):
if settings.USE_SDL == 2:
ports.fetch_project('sdl2', 'https://github.com/emscripten-ports/SDL2/archive/master.zip', VERSION)
def create():
logging.warning('building port: sdl2')
# we are rebuilding SDL, clear dependant projects so they copy in their includes to ours properly
ports.clear_project_build('sdl2-image')
# copy includes to a location so they can be used as 'SDL2/'
source_include_path = os.path.join(ports.get_dir(), 'sdl2', 'SDL2-master', 'include')
dest_include_path = os.path.join(shared.Cache.get_path('ports-builds'), 'sdl2', 'include')
@ -38,7 +41,7 @@ def get(ports, settings, shared):
for src in srcs:
o = os.path.join(ports.get_build_dir(), 'sdl2', 'src', src + '.o')
shared.safe_ensure_dirs(os.path.dirname(o))
commands.append([shared.PYTHON, shared.EMCC, os.path.join(ports.get_dir(), 'sdl2', 'SDL2-master', 'src', src), '-O2', '-o', o, '-I' + dest_include_path, '-O2', '-DUSING_GENERATED_CONFIG_H'])
commands.append([shared.PYTHON, shared.EMCC, os.path.join(ports.get_dir(), 'sdl2', 'SDL2-master', 'src', src), '-O2', '-o', o, '-I' + dest_include_path, '-O2', '-DUSING_GENERATED_CONFIG_H', '-Wno-warn-absolute-paths'])
o_s.append(o)
ports.run_commands(commands)
final = os.path.join(ports.get_build_dir(), 'sdl2', 'libsdl2.bc')

Просмотреть файл

@ -1,4 +1,4 @@
import os, shutil
import os, shutil, logging
VERSION = 1
@ -8,6 +8,7 @@ def get(ports, settings, shared):
assert os.path.exists(sdl_build), 'You must use SDL2 to use SDL2_image'
ports.fetch_project('sdl2-image', 'https://github.com/emscripten-ports/SDL2_image/archive/master.zip', VERSION)
def create():
logging.warning('building port: sdl2-image')
shutil.copyfile(os.path.join(ports.get_dir(), 'sdl2-image', 'SDL2_image-master', 'SDL_image.h'), os.path.join(ports.get_build_dir(), 'sdl2', 'include', 'SDL_image.h'))
shutil.copyfile(os.path.join(ports.get_dir(), 'sdl2-image', 'SDL2_image-master', 'SDL_image.h'), os.path.join(ports.get_build_dir(), 'sdl2', 'include', 'SDL2', 'SDL_image.h'))
srcs = 'IMG.c IMG_bmp.c IMG_gif.c IMG_jpg.c IMG_lbm.c IMG_pcx.c IMG_png.c IMG_pnm.c IMG_tga.c IMG_tif.c IMG_xcf.c IMG_xpm.c IMG_xv.c IMG_webp.c IMG_ImageIO.m'.split(' ')

Просмотреть файл

@ -667,8 +667,7 @@ class Ports:
if State.unpacked:
# we unpacked a new version, clear the build in the cache
shared.try_delete(os.path.join(Ports.get_build_dir(), name))
shared.try_delete(shared.Cache.get_path(name + '.bc'))
Ports.clear_project_build(name)
@staticmethod
def build_project(name, subdir, configure, generated_libs, post_create=None):
@ -680,10 +679,13 @@ class Ports:
configure=configure, make=['make', '-j' + str(CORES)])
assert len(libs) == 1
if post_create: post_create()
logging.warning(' building complete')
return libs[0]
return shared.Cache.get(name, create)
@staticmethod
def clear_project_build(name):
shared.try_delete(os.path.join(Ports.get_build_dir(), name))
shared.try_delete(shared.Cache.get_path(name + '.bc'))
def get_ports(settings):
ret = []