Skip to content

Commit

Permalink
Fix compilation on windows.
Browse files Browse the repository at this point in the history
It didn't work if we link with -lz before -lpng.
  • Loading branch information
guillaumechereau committed Sep 16, 2018
1 parent 4e54cc7 commit 5541dee
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions SConstruct
Original file line number Diff line number Diff line change
Expand Up @@ -81,6 +81,10 @@ sources = glob.glob('src/*.c') + glob.glob('src/*.cpp') + \
glob.glob('src/formats/*.c') + \
glob.glob('src/tools/*.c')

# Check for libpng.
if conf.CheckLibWithHeader('libpng', 'png.h', 'c'):
env.Append(CCFLAGS='-DHAVE_LIBPNG=1')

# Linux compilation support.
if target_os == 'posix':
env.Append(LIBS=['GL', 'm', 'z'])
Expand Down Expand Up @@ -117,9 +121,6 @@ sources += glob.glob('ext_src/inih/*.c')
env.Append(CPPPATH=['ext_src/inih'])
env.Append(CFLAGS='-DINI_HANDLER_LINENO=1')

if conf.CheckLibWithHeader('libpng', 'png.h', 'c'):
env.Append(CCFLAGS='-DHAVE_LIBPNG=1')

if sound:
env.Append(LIBS='openal')
env.Append(CCFLAGS='-DSOUND=1')
Expand Down

0 comments on commit 5541dee

Please sign in to comment.