1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
|
--- SConstruct.orig 2022-08-16 08:30:35 UTC
+++ SConstruct
@@ -45,10 +45,6 @@ if os.environ.get('CC') == 'clang':
if os.environ.get('CC') == 'clang':
env.Replace(CC='clang', CXX='clang++')
-# Hack for gcc <= 5, since pragma diagnostic push doesn't seem to work.
-if env['CCVERSION'] and int(env['CCVERSION'].split('.')[0]) <= 5:
- env.Append(CCFLAGS=['-Wno-unused-function'])
-
# Asan & Ubsan (need to come first).
if env['mode'] == 'debug' and target_os == 'posix':
env.Append(CCFLAGS=['-fsanitize=address', '-fsanitize=undefined'],
@@ -70,7 +66,7 @@ if env['mode'] not in ['debug', 'analyze']:
env.Append(CCFLAGS='-Werror')
if env['mode'] not in ['debug', 'analyze']:
- env.Append(CPPDEFINES='NDEBUG', CCFLAGS='-Ofast')
+ env.Append(CPPDEFINES='NDEBUG')
if env['mode'] == 'debug':
env.Append(CCFLAGS=['-O0'])
@@ -88,16 +84,14 @@ for root, dirnames, filenames in os.walk('src'):
if filename.endswith('.c') or filename.endswith('.cpp'):
sources.append(os.path.join(root, filename))
-# Check for libpng.
-if conf.CheckLibWithHeader('libpng', 'png.h', 'c'):
- env.Append(CPPDEFINES='HAVE_LIBPNG=1')
-
# Linux compilation support.
if target_os == 'posix':
+ env.Append(CPPDEFINES='HAVE_LIBPNG=1')
env.Append(LIBS=['GL', 'm'])
# Note: add '--static' to link with all the libs needed by glfw3.
env.ParseConfig('pkg-config --libs glfw3')
env.ParseConfig('pkg-config --cflags --libs gtk+-3.0')
+ env.ParseConfig('pkg-config --libs libpng')
# Windows compilation support.
if target_os == 'msys':
|