Skip to content

Commit c2a669a

Browse files
committed
SCons: Review uses of CCFLAGS, CXXFLAGS and CPPFLAGS
Many contributors (me included) did not fully understand what CCFLAGS, CXXFLAGS and CPPFLAGS refer to exactly, and were thus not using them in the way they are intended to be. As per the SCons manual: https://www.scons.org/doc/HTML/scons-user/apa.html - CCFLAGS: General options that are passed to the C and C++ compilers. - CFLAGS: General options that are passed to the C compiler (C only; not C++). - CXXFLAGS: General options that are passed to the C++ compiler. By default, this includes the value of $CCFLAGS, so that setting $CCFLAGS affects both C and C++ compilation. - CPPFLAGS: User-specified C preprocessor options. These will be included in any command that uses the C preprocessor, including not just compilation of C and C++ source files [...], but also [...] Fortran [...] and [...] assembly language source file[s]. TL;DR: Compiler options go to CCFLAGS, unless they must be restricted to either C (CFLAGS) or C++ (CXXFLAGS). Preprocessor defines go to CPPFLAGS.
1 parent e1d16e7 commit c2a669a

File tree

23 files changed

+122
-101
lines changed

23 files changed

+122
-101
lines changed

SConstruct

+11-9
Original file line numberDiff line numberDiff line change
@@ -161,8 +161,8 @@ opts.Add("CXX", "C++ compiler")
161161
opts.Add("CC", "C compiler")
162162
opts.Add("LINK", "Linker")
163163
opts.Add("CCFLAGS", "Custom flags for both the C and C++ compilers")
164-
opts.Add("CXXFLAGS", "Custom flags for the C++ compiler")
165164
opts.Add("CFLAGS", "Custom flags for the C compiler")
165+
opts.Add("CXXFLAGS", "Custom flags for the C++ compiler")
166166
opts.Add("LINKFLAGS", "Custom flags for the linker")
167167

168168
# add platform specific options
@@ -271,17 +271,18 @@ if selected_platform in platform_list:
271271

272272
CCFLAGS = env.get('CCFLAGS', '')
273273
env['CCFLAGS'] = ''
274-
275274
env.Append(CCFLAGS=str(CCFLAGS).split())
276275

277276
CFLAGS = env.get('CFLAGS', '')
278277
env['CFLAGS'] = ''
279-
280278
env.Append(CFLAGS=str(CFLAGS).split())
281279

280+
CXXFLAGS = env.get('CXXFLAGS', '')
281+
env['CXXFLAGS'] = ''
282+
env.Append(CXXFLAGS=str(CXXFLAGS).split())
283+
282284
LINKFLAGS = env.get('LINKFLAGS', '')
283285
env['LINKFLAGS'] = ''
284-
285286
env.Append(LINKFLAGS=str(LINKFLAGS).split())
286287

287288
flag_list = platform_flags[selected_platform]
@@ -322,15 +323,16 @@ if selected_platform in platform_list:
322323
# FIXME: enable -Wlogical-op and -Wduplicated-branches once #27594 is merged
323324
# Note: enable -Wimplicit-fallthrough for Clang (already part of -Wextra for GCC)
324325
# once we switch to C++11 or later (necessary for our FALLTHROUGH macro).
325-
env.Append(CCFLAGS=['-Wall', '-Wextra', '-Wno-unused-parameter',
326-
'-Wctor-dtor-privacy', '-Wnon-virtual-dtor']
326+
env.Append(CCFLAGS=['-Wall', '-Wextra', '-Wno-unused-parameter']
327327
+ all_plus_warnings + shadow_local_warning)
328+
env.Append(CXXFLAGS=['-Wctor-dtor-privacy', '-Wnon-virtual-dtor'])
328329
if methods.using_gcc(env):
329-
env['CCFLAGS'] += ['-Wno-clobbered', '-Walloc-zero', '-Wnoexcept',
330-
'-Wduplicated-cond', '-Wplacement-new=1', '-Wstringop-overflow=4']
330+
env.Append(CCFLAGS=['-Wno-clobbered', '-Walloc-zero',
331+
'-Wduplicated-cond', '-Wstringop-overflow=4'])
332+
env.Append(CXXFLAGS=['-Wnoexcept', '-Wplacement-new=1'])
331333
version = methods.get_compiler_version(env)
332334
if version != None and version[0] >= '9':
333-
env['CCFLAGS'] += ['-Wattribute-alias=2']
335+
env.Append(CCFLAGS=['-Wattribute-alias=2'])
334336
elif (env["warnings"] == 'all'):
335337
env.Append(CCFLAGS=['-Wall'] + shadow_local_warning)
336338
elif (env["warnings"] == 'moderate'):

core/SCsub

+2-2
Original file line numberDiff line numberDiff line change
@@ -129,10 +129,10 @@ if env['builtin_zstd']:
129129
thirdparty_zstd_sources = [thirdparty_zstd_dir + file for file in thirdparty_zstd_sources]
130130

131131
env_thirdparty.Append(CPPPATH=[thirdparty_zstd_dir, thirdparty_zstd_dir + "common"])
132-
env_thirdparty.Append(CCFLAGS="-DZSTD_STATIC_LINKING_ONLY")
132+
env_thirdparty.Append(CPPFLAGS="-DZSTD_STATIC_LINKING_ONLY")
133133
env.Append(CPPPATH=thirdparty_zstd_dir)
134134
# Also needed in main env includes will trigger warnings
135-
env.Append(CCFLAGS="-DZSTD_STATIC_LINKING_ONLY")
135+
env.Append(CPPFLAGS="-DZSTD_STATIC_LINKING_ONLY")
136136

137137
env_thirdparty.add_source_files(env.core_sources, thirdparty_zstd_sources)
138138

drivers/xaudio2/SCsub

+1-1
Original file line numberDiff line numberDiff line change
@@ -3,5 +3,5 @@
33
Import('env')
44

55
env.add_source_files(env.drivers_sources, "*.cpp")
6-
env.Append(CXXFLAGS=['-DXAUDIO2_ENABLED'])
6+
env.Append(CPPFLAGS=['-DXAUDIO2_ENABLED'])
77
env.Append(LINKFLAGS=['xaudio2_8.lib'])

methods.py

+2-2
Original file line numberDiff line numberDiff line change
@@ -29,11 +29,11 @@ def disable_warnings(self):
2929
self.Append(CPPFLAGS=['/w'])
3030
self['CCFLAGS'] = [x for x in self['CCFLAGS'] if not x in warn_flags]
3131
self['CFLAGS'] = [x for x in self['CFLAGS'] if not x in warn_flags]
32-
self['CPPFLAGS'] = [x for x in self['CPPFLAGS'] if not x in warn_flags]
32+
self['CXXFLAGS'] = [x for x in self['CXXFLAGS'] if not x in warn_flags]
3333
else:
3434
self.Append(CCFLAGS=['-w'])
3535
self.Append(CFLAGS=['-w'])
36-
self.Append(CPPFLAGS=['-w'])
36+
self.Append(CXXFLAGS=['-w'])
3737

3838

3939
def add_module_version_string(self,s):

modules/bullet/SCsub

+1-1
Original file line numberDiff line numberDiff line change
@@ -188,7 +188,7 @@ if env['builtin_bullet']:
188188

189189
env_bullet.Append(CPPPATH=[thirdparty_dir])
190190
# if env['target'] == "debug" or env['target'] == "release_debug":
191-
# env_bullet.Append(CCFLAGS=['-DBT_DEBUG'])
191+
# env_bullet.Append(CPPFLAGS=['-DBT_DEBUG'])
192192

193193
env_thirdparty = env_bullet.Clone()
194194
env_thirdparty.disable_warnings()

modules/etc/SCsub

+1-1
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ env_etc.Append(CPPPATH=[thirdparty_dir])
3131

3232
# upstream uses c++11
3333
if not env.msvc:
34-
env_etc.Append(CCFLAGS="-std=c++11")
34+
env_etc.Append(CXXFLAGS="-std=c++11")
3535

3636
env_thirdparty = env_etc.Clone()
3737
env_thirdparty.disable_warnings()

modules/freetype/SCsub

+3-3
Original file line numberDiff line numberDiff line change
@@ -72,9 +72,9 @@ if env['builtin_freetype']:
7272
# Also needed in main env for scene/
7373
env.Append(CPPPATH=[thirdparty_dir + "/include"])
7474

75-
env_freetype.Append(CCFLAGS=['-DFT2_BUILD_LIBRARY', '-DFT_CONFIG_OPTION_USE_PNG'])
75+
env_freetype.Append(CPPFLAGS=['-DFT2_BUILD_LIBRARY', '-DFT_CONFIG_OPTION_USE_PNG'])
7676
if (env['target'] != 'release'):
77-
env_freetype.Append(CCFLAGS=['-DZLIB_DEBUG'])
77+
env_freetype.Append(CPPFLAGS=['-DZLIB_DEBUG'])
7878

7979
# Also requires libpng headers
8080
if env['builtin_libpng']:
@@ -100,4 +100,4 @@ if env['builtin_freetype']:
100100
# Godot source files
101101
env_freetype.add_source_files(env.modules_sources, "*.cpp")
102102
# Used in scene/, needs to be in main env
103-
env.Append(CCFLAGS=['-DFREETYPE_ENABLED'])
103+
env.Append(CPPFLAGS=['-DFREETYPE_ENABLED'])

modules/opus/SCsub

+6-6
Original file line numberDiff line numberDiff line change
@@ -139,7 +139,7 @@ if env['builtin_opus']:
139139
opus_sources_silk = []
140140

141141
if env["platform"] in ["android", "iphone", "javascript"]:
142-
env_opus.Append(CFLAGS=["-DFIXED_POINT"])
142+
env_opus.Append(CPPFLAGS=["-DFIXED_POINT"])
143143
opus_sources_silk = [
144144
"silk/fixed/LTP_analysis_filter_FIX.c",
145145
"silk/fixed/LTP_scale_ctrl_FIX.c",
@@ -208,7 +208,7 @@ if env['builtin_opus']:
208208
if env['builtin_libogg']:
209209
env_opus.Append(CPPPATH=["#thirdparty/libogg"])
210210

211-
env_opus.Append(CFLAGS=["-DHAVE_CONFIG_H"])
211+
env_opus.Append(CPPFLAGS=["-DHAVE_CONFIG_H"])
212212

213213
thirdparty_include_paths = [
214214
"",
@@ -222,14 +222,14 @@ if env['builtin_opus']:
222222

223223
if env["platform"] == "android":
224224
if ("android_arch" in env and env["android_arch"] in ["armv6", "armv7"]):
225-
env_opus.Append(CFLAGS=["-DOPUS_ARM_OPT"])
225+
env_opus.Append(CPPFLAGS=["-DOPUS_ARM_OPT"])
226226
elif ("android_arch" in env and env["android_arch"] == "arm64v8"):
227-
env_opus.Append(CFLAGS=["-DOPUS_ARM64_OPT"])
227+
env_opus.Append(CPPFLAGS=["-DOPUS_ARM64_OPT"])
228228
elif env["platform"] == "iphone":
229229
if ("arch" in env and env["arch"] == "arm"):
230-
env_opus.Append(CFLAGS=["-DOPUS_ARM_OPT"])
230+
env_opus.Append(CPPFLAGS=["-DOPUS_ARM_OPT"])
231231
elif ("arch" in env and env["arch"] == "arm64"):
232-
env_opus.Append(CFLAGS=["-DOPUS_ARM64_OPT"])
232+
env_opus.Append(CPPFLAGS=["-DOPUS_ARM64_OPT"])
233233

234234
env_thirdparty = env_opus.Clone()
235235
env_thirdparty.disable_warnings()

modules/svg/SCsub

+1-1
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ env_svg.Append(CPPPATH=[thirdparty_dir])
1616
# FIXME: Needed in editor/editor_themes.cpp for now, but ideally there
1717
# shouldn't be a dependency on modules/ and its own 3rd party deps.
1818
env.Append(CPPPATH=[thirdparty_dir])
19-
env.Append(CCFLAGS=["-DSVG_ENABLED"])
19+
env.Append(CPPFLAGS=["-DSVG_ENABLED"])
2020

2121
env_thirdparty = env_svg.Clone()
2222
env_thirdparty.disable_warnings()

modules/theora/SCsub

+1-1
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,7 @@ if env['builtin_libtheora']:
6666
thirdparty_sources += thirdparty_sources_x86_vc
6767

6868
if (env["x86_libtheora_opt_gcc"] or env["x86_libtheora_opt_vc"]):
69-
env_theora.Append(CCFLAGS=["-DOC_X86_ASM"])
69+
env_theora.Append(CPPFLAGS=["-DOC_X86_ASM"])
7070

7171
thirdparty_sources = [thirdparty_dir + file for file in thirdparty_sources]
7272

modules/vhacd/SCsub

+1-1
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ env_vhacd.Append(CPPFLAGS=["-DGODOT_ENET"])
2929

3030
# upstream uses c++11
3131
if not env.msvc:
32-
env_vhacd.Append(CCFLAGS="-std=c++11")
32+
env_vhacd.Append(CXXFLAGS="-std=c++11")
3333

3434
env_thirdparty = env_vhacd.Clone()
3535
env_thirdparty.disable_warnings()

modules/webm/SCsub

+1-1
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ env_webm.Append(CPPPATH=[thirdparty_dir, thirdparty_dir + "libwebm/"])
1919

2020
# upstream uses c++11
2121
if (not env_webm.msvc):
22-
env_webm.Append(CCFLAGS="-std=c++11")
22+
env_webm.Append(CXXFLAGS="-std=c++11")
2323

2424
# also requires libogg, libvorbis and libopus
2525
if env['builtin_libogg']:

modules/webm/libvpx/SCsub

+2-2
Original file line numberDiff line numberDiff line change
@@ -323,7 +323,7 @@ if webm_cpu_x86:
323323
elif cpu_bits == '64':
324324
env_libvpx["ASCPU"] = 'X86_64'
325325

326-
env_libvpx.Append(CCFLAGS=['-DWEBM_X86ASM'])
326+
env_libvpx.Append(CPPFLAGS=['-DWEBM_X86ASM'])
327327

328328
webm_simd_optimizations = True
329329

@@ -337,7 +337,7 @@ if webm_cpu_arm:
337337
env_libvpx["ASFLAGS"] = ''
338338
env_libvpx["ASCOM"] = '$AS $ASFLAGS -o $TARGET $SOURCES'
339339

340-
env_libvpx.Append(CCFLAGS=['-DWEBM_ARMASM'])
340+
env_libvpx.Append(CPPFLAGS=['-DWEBM_ARMASM'])
341341

342342
webm_simd_optimizations = True
343343

modules/websocket/SCsub

+1-1
Original file line numberDiff line numberDiff line change
@@ -88,7 +88,7 @@ if env['builtin_libwebsockets'] and not env["platform"] == "javascript": # alrea
8888
env_lws.Append(CPPPATH=[helper_dir])
8989

9090
if env["platform"] == "uwp":
91-
env_lws.Append(CCFLAGS=["/DLWS_MINGW_SUPPORT"])
91+
env_lws.Append(CPPFLAGS=["/DLWS_MINGW_SUPPORT"])
9292

9393
env_thirdparty = env_lws.Clone()
9494
env_thirdparty.disable_warnings()

modules/xatlas_unwrap/SCsub

+6-6
Original file line numberDiff line numberDiff line change
@@ -24,18 +24,18 @@ if env['builtin_xatlas']:
2424
if env["platform"] == 'x11':
2525
# if not specifically one of the *BSD, then use LINUX as default
2626
if platform.system() == "FreeBSD":
27-
env_xatlas_unwrap.Append(CCFLAGS=["-DNV_OS_FREEBSD", "-DPOSH_COMPILER_GCC"])
27+
env_xatlas_unwrap.Append(CPPFLAGS=["-DNV_OS_FREEBSD", "-DPOSH_COMPILER_GCC"])
2828
elif platform.system() == "OpenBSD":
29-
env_xatlas_unwrap.Append(CCFLAGS=["-DNV_OS_OPENBSD", "-DPOSH_COMPILER_GCC"])
29+
env_xatlas_unwrap.Append(CPPFLAGS=["-DNV_OS_OPENBSD", "-DPOSH_COMPILER_GCC"])
3030
else:
31-
env_xatlas_unwrap.Append(CCFLAGS=["-DNV_OS_LINUX", "-DPOSH_COMPILER_GCC"])
31+
env_xatlas_unwrap.Append(CPPFLAGS=["-DNV_OS_LINUX", "-DPOSH_COMPILER_GCC"])
3232
elif env["platform"] == 'osx':
33-
env_xatlas_unwrap.Append(CCFLAGS=["-DNV_OS_DARWIN", "-DPOSH_COMPILER_GCC"])
33+
env_xatlas_unwrap.Append(CPPFLAGS=["-DNV_OS_DARWIN", "-DPOSH_COMPILER_GCC"])
3434
elif env["platform"] == 'windows':
3535
if env.msvc:
36-
env_xatlas_unwrap.Append(CCFLAGS=["-DNV_OS_WIN32", "-DNV_CC_MSVC", "-DPOSH_COMPILER_MSVC" ])
36+
env_xatlas_unwrap.Append(CPPFLAGS=["-DNV_OS_WIN32", "-DNV_CC_MSVC", "-DPOSH_COMPILER_MSVC" ])
3737
else:
38-
env_xatlas_unwrap.Append(CCFLAGS=["-DNV_OS_MINGW", "-DNV_CC_GNUC", "-DPOSH_COMPILER_GCC", "-U__STRICT_ANSI__"])
38+
env_xatlas_unwrap.Append(CPPFLAGS=["-DNV_OS_MINGW", "-DNV_CC_GNUC", "-DPOSH_COMPILER_GCC", "-U__STRICT_ANSI__"])
3939
env.Append(LIBS=["dbghelp"])
4040

4141
env_thirdparty = env_xatlas_unwrap.Clone()

platform/android/detect.py

+27-21
Original file line numberDiff line numberDiff line change
@@ -150,19 +150,21 @@ def mySpawn(sh, escape, cmd, args, env):
150150
if (env["target"].startswith("release")):
151151
if (env["optimize"] == "speed"): #optimize for speed (default)
152152
env.Append(LINKFLAGS=['-O2'])
153-
env.Append(CPPFLAGS=['-O2', '-DNDEBUG', '-fomit-frame-pointer'])
153+
env.Append(CCFLAGS=['-O2', '-fomit-frame-pointer'])
154+
env.Append(CPPFLAGS=['-DNDEBUG'])
154155
else: #optimize for size
155-
env.Append(CPPFLAGS=['-Os', '-DNDEBUG'])
156+
env.Append(CCFLAGS=['-Os'])
157+
env.Append(CPPFLAGS=['-DNDEBUG'])
156158
env.Append(LINKFLAGS=['-Os'])
157159

158160
if (can_vectorize):
159-
env.Append(CPPFLAGS=['-ftree-vectorize'])
161+
env.Append(CCFLAGS=['-ftree-vectorize'])
160162
if (env["target"] == "release_debug"):
161163
env.Append(CPPFLAGS=['-DDEBUG_ENABLED'])
162164
elif (env["target"] == "debug"):
163165
env.Append(LINKFLAGS=['-O0'])
164-
env.Append(CPPFLAGS=['-O0', '-D_DEBUG', '-UNDEBUG', '-DDEBUG_ENABLED',
165-
'-DDEBUG_MEMORY_ENABLED', '-g', '-fno-limit-debug-info'])
166+
env.Append(CCFLAGS=['-O0', '-g', '-fno-limit-debug-info'])
167+
env.Append(CPPFLAGS=['-D_DEBUG', '-UNDEBUG', '-DDEBUG_ENABLED', '-DDEBUG_MEMORY_ENABLED'])
166168

167169
## Compiler configuration
168170

@@ -216,15 +218,16 @@ def mySpawn(sh, escape, cmd, args, env):
216218
if env['android_stl']:
217219
env.Append(CPPFLAGS=["-isystem", env["ANDROID_NDK_ROOT"] + "/sources/cxx-stl/llvm-libc++/include"])
218220
env.Append(CPPFLAGS=["-isystem", env["ANDROID_NDK_ROOT"] + "/sources/cxx-stl/llvm-libc++abi/include"])
219-
env.Append(CXXFLAGS=['-frtti',"-std=gnu++14"])
221+
env.Append(CXXFLAGS=['-frtti', "-std=gnu++14"])
220222
else:
221-
env.Append(CXXFLAGS=['-fno-rtti', '-fno-exceptions', '-DNO_SAFE_CAST'])
223+
env.Append(CXXFLAGS=['-fno-rtti', '-fno-exceptions'])
224+
env.Append(CPPFLAGS=['-DNO_SAFE_CAST'])
222225

223226
ndk_version = get_ndk_version(env["ANDROID_NDK_ROOT"])
224227
if ndk_version != None and LooseVersion(ndk_version) >= LooseVersion("15.0.4075724"):
225228
print("Using NDK unified headers")
226229
sysroot = env["ANDROID_NDK_ROOT"] + "/sysroot"
227-
env.Append(CPPFLAGS=["--sysroot="+sysroot])
230+
env.Append(CPPFLAGS=["--sysroot=" + sysroot])
228231
env.Append(CPPFLAGS=["-isystem", sysroot + "/usr/include/" + abi_subpath])
229232
env.Append(CPPFLAGS=["-isystem", env["ANDROID_NDK_ROOT"] + "/sources/android/support/include"])
230233
# For unified headers this define has to be set manually
@@ -233,48 +236,51 @@ def mySpawn(sh, escape, cmd, args, env):
233236
print("Using NDK deprecated headers")
234237
env.Append(CPPFLAGS=["-isystem", lib_sysroot + "/usr/include"])
235238

236-
env.Append(CPPFLAGS='-fpic -ffunction-sections -funwind-tables -fstack-protector-strong -fvisibility=hidden -fno-strict-aliasing'.split())
239+
env.Append(CCFLAGS='-fpic -ffunction-sections -funwind-tables -fstack-protector-strong -fvisibility=hidden -fno-strict-aliasing'.split())
237240
env.Append(CPPFLAGS='-DNO_STATVFS -DGLES_ENABLED'.split())
238241

239242
env['neon_enabled'] = False
240243
if env['android_arch'] == 'x86':
241244
target_opts = ['-target', 'i686-none-linux-android']
242245
# The NDK adds this if targeting API < 21, so we can drop it when Godot targets it at least
243-
env.Append(CPPFLAGS=['-mstackrealign'])
246+
env.Append(CCFLAGS=['-mstackrealign'])
244247

245248
elif env['android_arch'] == 'x86_64':
246249
target_opts = ['-target', 'x86_64-none-linux-android']
247250

248251
elif env["android_arch"] == "armv6":
249252
target_opts = ['-target', 'armv6-none-linux-androideabi']
250-
env.Append(CPPFLAGS='-D__ARM_ARCH_6__ -march=armv6 -mfpu=vfp -mfloat-abi=softfp'.split())
253+
env.Append(CCFLAGS='-march=armv6 -mfpu=vfp -mfloat-abi=softfp'.split())
254+
env.Append(CPPFLAGS=['-D__ARM_ARCH_6__'])
251255

252256
elif env["android_arch"] == "armv7":
253257
target_opts = ['-target', 'armv7-none-linux-androideabi']
254-
env.Append(CPPFLAGS='-D__ARM_ARCH_7__ -D__ARM_ARCH_7A__ -march=armv7-a -mfloat-abi=softfp'.split())
258+
env.Append(CCFLAGS='-march=armv7-a -mfloat-abi=softfp'.split())
259+
env.Append(CPPFLAGS='-D__ARM_ARCH_7__ -D__ARM_ARCH_7A__'.split())
255260
if env['android_neon']:
256261
env['neon_enabled'] = True
257-
env.Append(CPPFLAGS=['-mfpu=neon', '-D__ARM_NEON__'])
262+
env.Append(CCFLAGS=['-mfpu=neon'])
263+
env.Append(CPPFLAGS=['-D__ARM_NEON__'])
258264
else:
259-
env.Append(CPPFLAGS=['-mfpu=vfpv3-d16'])
265+
env.Append(CCFLAGS=['-mfpu=vfpv3-d16'])
260266

261267
elif env["android_arch"] == "arm64v8":
262268
target_opts = ['-target', 'aarch64-none-linux-android']
269+
env.Append(CCFLAGS=['-mfix-cortex-a53-835769'])
263270
env.Append(CPPFLAGS=['-D__ARM_ARCH_8A__'])
264-
env.Append(CPPFLAGS=['-mfix-cortex-a53-835769'])
265271

266-
env.Append(CPPFLAGS=target_opts)
267-
env.Append(CPPFLAGS=common_opts)
272+
env.Append(CCFLAGS=target_opts)
273+
env.Append(CCFLAGS=common_opts)
268274

269275
## Link flags
270276
if ndk_version != None and LooseVersion(ndk_version) >= LooseVersion("15.0.4075724"):
271277
if LooseVersion(ndk_version) >= LooseVersion("17.1.4828580"):
272-
env.Append(LINKFLAGS=['-Wl,--exclude-libs,libgcc.a','-Wl,--exclude-libs,libatomic.a','-nostdlib++'])
278+
env.Append(LINKFLAGS=['-Wl,--exclude-libs,libgcc.a', '-Wl,--exclude-libs,libatomic.a', '-nostdlib++'])
273279
else:
274-
env.Append(LINKFLAGS=[env["ANDROID_NDK_ROOT"] +"/sources/cxx-stl/llvm-libc++/libs/"+arch_subpath+"/libandroid_support.a"])
280+
env.Append(LINKFLAGS=[env["ANDROID_NDK_ROOT"] + "/sources/cxx-stl/llvm-libc++/libs/" + arch_subpath + "/libandroid_support.a"])
275281
env.Append(LINKFLAGS=['-shared', '--sysroot=' + lib_sysroot, '-Wl,--warn-shared-textrel'])
276-
env.Append(LIBPATH=[env["ANDROID_NDK_ROOT"] + "/sources/cxx-stl/llvm-libc++/libs/"+arch_subpath+"/"])
277-
env.Append(LINKFLAGS=[env["ANDROID_NDK_ROOT"] +"/sources/cxx-stl/llvm-libc++/libs/"+arch_subpath+"/libc++_shared.so"])
282+
env.Append(LIBPATH=[env["ANDROID_NDK_ROOT"] + "/sources/cxx-stl/llvm-libc++/libs/" + arch_subpath + "/"])
283+
env.Append(LINKFLAGS=[env["ANDROID_NDK_ROOT"] +"/sources/cxx-stl/llvm-libc++/libs/" + arch_subpath + "/libc++_shared.so"])
278284
else:
279285
env.Append(LINKFLAGS=['-shared', '--sysroot=' + lib_sysroot, '-Wl,--warn-shared-textrel'])
280286
if mt_link:

platform/haiku/detect.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -150,6 +150,6 @@ def configure(env):
150150
env.Append(CPPPATH=['#platform/haiku'])
151151
env.Append(CPPFLAGS=['-DUNIX_ENABLED', '-DOPENGL_ENABLED', '-DGLES_ENABLED'])
152152
env.Append(CPPFLAGS=['-DMEDIA_KIT_ENABLED'])
153-
# env.Append(CCFLAGS=['-DFREETYPE_ENABLED'])
153+
# env.Append(CPPFLAGS=['-DFREETYPE_ENABLED'])
154154
env.Append(CPPFLAGS=['-DPTHREAD_NO_RENAME']) # TODO: enable when we have pthread_setname_np
155155
env.Append(LIBS=['be', 'game', 'media', 'network', 'bnetapi', 'z', 'GL'])

0 commit comments

Comments
 (0)