Skip to content

Commit

Permalink
SCons: Review uses of CCFLAGS, CXXFLAGS and CPPFLAGS
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
akien-mga committed Apr 24, 2019
1 parent e1d16e7 commit c2a669a
Show file tree
Hide file tree
Showing 23 changed files with 122 additions and 101 deletions.
20 changes: 11 additions & 9 deletions SConstruct
Original file line number Diff line number Diff line change
Expand Up @@ -161,8 +161,8 @@ opts.Add("CXX", "C++ compiler")
opts.Add("CC", "C compiler")
opts.Add("LINK", "Linker")
opts.Add("CCFLAGS", "Custom flags for both the C and C++ compilers")
opts.Add("CXXFLAGS", "Custom flags for the C++ compiler")
opts.Add("CFLAGS", "Custom flags for the C compiler")
opts.Add("CXXFLAGS", "Custom flags for the C++ compiler")
opts.Add("LINKFLAGS", "Custom flags for the linker")

# add platform specific options
Expand Down Expand Up @@ -271,17 +271,18 @@ if selected_platform in platform_list:

CCFLAGS = env.get('CCFLAGS', '')
env['CCFLAGS'] = ''

env.Append(CCFLAGS=str(CCFLAGS).split())

CFLAGS = env.get('CFLAGS', '')
env['CFLAGS'] = ''

env.Append(CFLAGS=str(CFLAGS).split())

CXXFLAGS = env.get('CXXFLAGS', '')
env['CXXFLAGS'] = ''
env.Append(CXXFLAGS=str(CXXFLAGS).split())

LINKFLAGS = env.get('LINKFLAGS', '')
env['LINKFLAGS'] = ''

env.Append(LINKFLAGS=str(LINKFLAGS).split())

flag_list = platform_flags[selected_platform]
Expand Down Expand Up @@ -322,15 +323,16 @@ if selected_platform in platform_list:
# FIXME: enable -Wlogical-op and -Wduplicated-branches once #27594 is merged
# Note: enable -Wimplicit-fallthrough for Clang (already part of -Wextra for GCC)
# once we switch to C++11 or later (necessary for our FALLTHROUGH macro).
env.Append(CCFLAGS=['-Wall', '-Wextra', '-Wno-unused-parameter',
'-Wctor-dtor-privacy', '-Wnon-virtual-dtor']
env.Append(CCFLAGS=['-Wall', '-Wextra', '-Wno-unused-parameter']
+ all_plus_warnings + shadow_local_warning)
env.Append(CXXFLAGS=['-Wctor-dtor-privacy', '-Wnon-virtual-dtor'])
if methods.using_gcc(env):
env['CCFLAGS'] += ['-Wno-clobbered', '-Walloc-zero', '-Wnoexcept',
'-Wduplicated-cond', '-Wplacement-new=1', '-Wstringop-overflow=4']
env.Append(CCFLAGS=['-Wno-clobbered', '-Walloc-zero',
'-Wduplicated-cond', '-Wstringop-overflow=4'])
env.Append(CXXFLAGS=['-Wnoexcept', '-Wplacement-new=1'])
version = methods.get_compiler_version(env)
if version != None and version[0] >= '9':
env['CCFLAGS'] += ['-Wattribute-alias=2']
env.Append(CCFLAGS=['-Wattribute-alias=2'])
elif (env["warnings"] == 'all'):
env.Append(CCFLAGS=['-Wall'] + shadow_local_warning)
elif (env["warnings"] == 'moderate'):
Expand Down
4 changes: 2 additions & 2 deletions core/SCsub
Original file line number Diff line number Diff line change
Expand Up @@ -129,10 +129,10 @@ if env['builtin_zstd']:
thirdparty_zstd_sources = [thirdparty_zstd_dir + file for file in thirdparty_zstd_sources]

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

env_thirdparty.add_source_files(env.core_sources, thirdparty_zstd_sources)

Expand Down
2 changes: 1 addition & 1 deletion drivers/xaudio2/SCsub
Original file line number Diff line number Diff line change
Expand Up @@ -3,5 +3,5 @@
Import('env')

env.add_source_files(env.drivers_sources, "*.cpp")
env.Append(CXXFLAGS=['-DXAUDIO2_ENABLED'])
env.Append(CPPFLAGS=['-DXAUDIO2_ENABLED'])
env.Append(LINKFLAGS=['xaudio2_8.lib'])
4 changes: 2 additions & 2 deletions methods.py
Original file line number Diff line number Diff line change
Expand Up @@ -29,11 +29,11 @@ def disable_warnings(self):
self.Append(CPPFLAGS=['/w'])
self['CCFLAGS'] = [x for x in self['CCFLAGS'] if not x in warn_flags]
self['CFLAGS'] = [x for x in self['CFLAGS'] if not x in warn_flags]
self['CPPFLAGS'] = [x for x in self['CPPFLAGS'] if not x in warn_flags]
self['CXXFLAGS'] = [x for x in self['CXXFLAGS'] if not x in warn_flags]
else:
self.Append(CCFLAGS=['-w'])
self.Append(CFLAGS=['-w'])
self.Append(CPPFLAGS=['-w'])
self.Append(CXXFLAGS=['-w'])


def add_module_version_string(self,s):
Expand Down
2 changes: 1 addition & 1 deletion modules/bullet/SCsub
Original file line number Diff line number Diff line change
Expand Up @@ -188,7 +188,7 @@ if env['builtin_bullet']:

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

env_thirdparty = env_bullet.Clone()
env_thirdparty.disable_warnings()
Expand Down
2 changes: 1 addition & 1 deletion modules/etc/SCsub
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ env_etc.Append(CPPPATH=[thirdparty_dir])

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

env_thirdparty = env_etc.Clone()
env_thirdparty.disable_warnings()
Expand Down
6 changes: 3 additions & 3 deletions modules/freetype/SCsub
Original file line number Diff line number Diff line change
Expand Up @@ -72,9 +72,9 @@ if env['builtin_freetype']:
# Also needed in main env for scene/
env.Append(CPPPATH=[thirdparty_dir + "/include"])

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

# Also requires libpng headers
if env['builtin_libpng']:
Expand All @@ -100,4 +100,4 @@ if env['builtin_freetype']:
# Godot source files
env_freetype.add_source_files(env.modules_sources, "*.cpp")
# Used in scene/, needs to be in main env
env.Append(CCFLAGS=['-DFREETYPE_ENABLED'])
env.Append(CPPFLAGS=['-DFREETYPE_ENABLED'])
12 changes: 6 additions & 6 deletions modules/opus/SCsub
Original file line number Diff line number Diff line change
Expand Up @@ -139,7 +139,7 @@ if env['builtin_opus']:
opus_sources_silk = []

if env["platform"] in ["android", "iphone", "javascript"]:
env_opus.Append(CFLAGS=["-DFIXED_POINT"])
env_opus.Append(CPPFLAGS=["-DFIXED_POINT"])
opus_sources_silk = [
"silk/fixed/LTP_analysis_filter_FIX.c",
"silk/fixed/LTP_scale_ctrl_FIX.c",
Expand Down Expand Up @@ -208,7 +208,7 @@ if env['builtin_opus']:
if env['builtin_libogg']:
env_opus.Append(CPPPATH=["#thirdparty/libogg"])

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

thirdparty_include_paths = [
"",
Expand All @@ -222,14 +222,14 @@ if env['builtin_opus']:

if env["platform"] == "android":
if ("android_arch" in env and env["android_arch"] in ["armv6", "armv7"]):
env_opus.Append(CFLAGS=["-DOPUS_ARM_OPT"])
env_opus.Append(CPPFLAGS=["-DOPUS_ARM_OPT"])
elif ("android_arch" in env and env["android_arch"] == "arm64v8"):
env_opus.Append(CFLAGS=["-DOPUS_ARM64_OPT"])
env_opus.Append(CPPFLAGS=["-DOPUS_ARM64_OPT"])
elif env["platform"] == "iphone":
if ("arch" in env and env["arch"] == "arm"):
env_opus.Append(CFLAGS=["-DOPUS_ARM_OPT"])
env_opus.Append(CPPFLAGS=["-DOPUS_ARM_OPT"])
elif ("arch" in env and env["arch"] == "arm64"):
env_opus.Append(CFLAGS=["-DOPUS_ARM64_OPT"])
env_opus.Append(CPPFLAGS=["-DOPUS_ARM64_OPT"])

env_thirdparty = env_opus.Clone()
env_thirdparty.disable_warnings()
Expand Down
2 changes: 1 addition & 1 deletion modules/svg/SCsub
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ env_svg.Append(CPPPATH=[thirdparty_dir])
# FIXME: Needed in editor/editor_themes.cpp for now, but ideally there
# shouldn't be a dependency on modules/ and its own 3rd party deps.
env.Append(CPPPATH=[thirdparty_dir])
env.Append(CCFLAGS=["-DSVG_ENABLED"])
env.Append(CPPFLAGS=["-DSVG_ENABLED"])

env_thirdparty = env_svg.Clone()
env_thirdparty.disable_warnings()
Expand Down
2 changes: 1 addition & 1 deletion modules/theora/SCsub
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ if env['builtin_libtheora']:
thirdparty_sources += thirdparty_sources_x86_vc

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

thirdparty_sources = [thirdparty_dir + file for file in thirdparty_sources]

Expand Down
2 changes: 1 addition & 1 deletion modules/vhacd/SCsub
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ env_vhacd.Append(CPPFLAGS=["-DGODOT_ENET"])

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

env_thirdparty = env_vhacd.Clone()
env_thirdparty.disable_warnings()
Expand Down
2 changes: 1 addition & 1 deletion modules/webm/SCsub
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ env_webm.Append(CPPPATH=[thirdparty_dir, thirdparty_dir + "libwebm/"])

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

# also requires libogg, libvorbis and libopus
if env['builtin_libogg']:
Expand Down
4 changes: 2 additions & 2 deletions modules/webm/libvpx/SCsub
Original file line number Diff line number Diff line change
Expand Up @@ -323,7 +323,7 @@ if webm_cpu_x86:
elif cpu_bits == '64':
env_libvpx["ASCPU"] = 'X86_64'

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

webm_simd_optimizations = True

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

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

webm_simd_optimizations = True

Expand Down
2 changes: 1 addition & 1 deletion modules/websocket/SCsub
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@ if env['builtin_libwebsockets'] and not env["platform"] == "javascript": # alrea
env_lws.Append(CPPPATH=[helper_dir])

if env["platform"] == "uwp":
env_lws.Append(CCFLAGS=["/DLWS_MINGW_SUPPORT"])
env_lws.Append(CPPFLAGS=["/DLWS_MINGW_SUPPORT"])

env_thirdparty = env_lws.Clone()
env_thirdparty.disable_warnings()
Expand Down
12 changes: 6 additions & 6 deletions modules/xatlas_unwrap/SCsub
Original file line number Diff line number Diff line change
Expand Up @@ -24,18 +24,18 @@ if env['builtin_xatlas']:
if env["platform"] == 'x11':
# if not specifically one of the *BSD, then use LINUX as default
if platform.system() == "FreeBSD":
env_xatlas_unwrap.Append(CCFLAGS=["-DNV_OS_FREEBSD", "-DPOSH_COMPILER_GCC"])
env_xatlas_unwrap.Append(CPPFLAGS=["-DNV_OS_FREEBSD", "-DPOSH_COMPILER_GCC"])
elif platform.system() == "OpenBSD":
env_xatlas_unwrap.Append(CCFLAGS=["-DNV_OS_OPENBSD", "-DPOSH_COMPILER_GCC"])
env_xatlas_unwrap.Append(CPPFLAGS=["-DNV_OS_OPENBSD", "-DPOSH_COMPILER_GCC"])
else:
env_xatlas_unwrap.Append(CCFLAGS=["-DNV_OS_LINUX", "-DPOSH_COMPILER_GCC"])
env_xatlas_unwrap.Append(CPPFLAGS=["-DNV_OS_LINUX", "-DPOSH_COMPILER_GCC"])
elif env["platform"] == 'osx':
env_xatlas_unwrap.Append(CCFLAGS=["-DNV_OS_DARWIN", "-DPOSH_COMPILER_GCC"])
env_xatlas_unwrap.Append(CPPFLAGS=["-DNV_OS_DARWIN", "-DPOSH_COMPILER_GCC"])
elif env["platform"] == 'windows':
if env.msvc:
env_xatlas_unwrap.Append(CCFLAGS=["-DNV_OS_WIN32", "-DNV_CC_MSVC", "-DPOSH_COMPILER_MSVC" ])
env_xatlas_unwrap.Append(CPPFLAGS=["-DNV_OS_WIN32", "-DNV_CC_MSVC", "-DPOSH_COMPILER_MSVC" ])
else:
env_xatlas_unwrap.Append(CCFLAGS=["-DNV_OS_MINGW", "-DNV_CC_GNUC", "-DPOSH_COMPILER_GCC", "-U__STRICT_ANSI__"])
env_xatlas_unwrap.Append(CPPFLAGS=["-DNV_OS_MINGW", "-DNV_CC_GNUC", "-DPOSH_COMPILER_GCC", "-U__STRICT_ANSI__"])
env.Append(LIBS=["dbghelp"])

env_thirdparty = env_xatlas_unwrap.Clone()
Expand Down
48 changes: 27 additions & 21 deletions platform/android/detect.py
Original file line number Diff line number Diff line change
Expand Up @@ -150,19 +150,21 @@ def mySpawn(sh, escape, cmd, args, env):
if (env["target"].startswith("release")):
if (env["optimize"] == "speed"): #optimize for speed (default)
env.Append(LINKFLAGS=['-O2'])
env.Append(CPPFLAGS=['-O2', '-DNDEBUG', '-fomit-frame-pointer'])
env.Append(CCFLAGS=['-O2', '-fomit-frame-pointer'])
env.Append(CPPFLAGS=['-DNDEBUG'])
else: #optimize for size
env.Append(CPPFLAGS=['-Os', '-DNDEBUG'])
env.Append(CCFLAGS=['-Os'])
env.Append(CPPFLAGS=['-DNDEBUG'])
env.Append(LINKFLAGS=['-Os'])

if (can_vectorize):
env.Append(CPPFLAGS=['-ftree-vectorize'])
env.Append(CCFLAGS=['-ftree-vectorize'])
if (env["target"] == "release_debug"):
env.Append(CPPFLAGS=['-DDEBUG_ENABLED'])
elif (env["target"] == "debug"):
env.Append(LINKFLAGS=['-O0'])
env.Append(CPPFLAGS=['-O0', '-D_DEBUG', '-UNDEBUG', '-DDEBUG_ENABLED',
'-DDEBUG_MEMORY_ENABLED', '-g', '-fno-limit-debug-info'])
env.Append(CCFLAGS=['-O0', '-g', '-fno-limit-debug-info'])
env.Append(CPPFLAGS=['-D_DEBUG', '-UNDEBUG', '-DDEBUG_ENABLED', '-DDEBUG_MEMORY_ENABLED'])

## Compiler configuration

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

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

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

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

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

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

elif env["android_arch"] == "armv7":
target_opts = ['-target', 'armv7-none-linux-androideabi']
env.Append(CPPFLAGS='-D__ARM_ARCH_7__ -D__ARM_ARCH_7A__ -march=armv7-a -mfloat-abi=softfp'.split())
env.Append(CCFLAGS='-march=armv7-a -mfloat-abi=softfp'.split())
env.Append(CPPFLAGS='-D__ARM_ARCH_7__ -D__ARM_ARCH_7A__'.split())
if env['android_neon']:
env['neon_enabled'] = True
env.Append(CPPFLAGS=['-mfpu=neon', '-D__ARM_NEON__'])
env.Append(CCFLAGS=['-mfpu=neon'])
env.Append(CPPFLAGS=['-D__ARM_NEON__'])
else:
env.Append(CPPFLAGS=['-mfpu=vfpv3-d16'])
env.Append(CCFLAGS=['-mfpu=vfpv3-d16'])

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

env.Append(CPPFLAGS=target_opts)
env.Append(CPPFLAGS=common_opts)
env.Append(CCFLAGS=target_opts)
env.Append(CCFLAGS=common_opts)

## Link flags
if ndk_version != None and LooseVersion(ndk_version) >= LooseVersion("15.0.4075724"):
if LooseVersion(ndk_version) >= LooseVersion("17.1.4828580"):
env.Append(LINKFLAGS=['-Wl,--exclude-libs,libgcc.a','-Wl,--exclude-libs,libatomic.a','-nostdlib++'])
env.Append(LINKFLAGS=['-Wl,--exclude-libs,libgcc.a', '-Wl,--exclude-libs,libatomic.a', '-nostdlib++'])
else:
env.Append(LINKFLAGS=[env["ANDROID_NDK_ROOT"] +"/sources/cxx-stl/llvm-libc++/libs/"+arch_subpath+"/libandroid_support.a"])
env.Append(LINKFLAGS=[env["ANDROID_NDK_ROOT"] + "/sources/cxx-stl/llvm-libc++/libs/" + arch_subpath + "/libandroid_support.a"])
env.Append(LINKFLAGS=['-shared', '--sysroot=' + lib_sysroot, '-Wl,--warn-shared-textrel'])
env.Append(LIBPATH=[env["ANDROID_NDK_ROOT"] + "/sources/cxx-stl/llvm-libc++/libs/"+arch_subpath+"/"])
env.Append(LINKFLAGS=[env["ANDROID_NDK_ROOT"] +"/sources/cxx-stl/llvm-libc++/libs/"+arch_subpath+"/libc++_shared.so"])
env.Append(LIBPATH=[env["ANDROID_NDK_ROOT"] + "/sources/cxx-stl/llvm-libc++/libs/" + arch_subpath + "/"])
env.Append(LINKFLAGS=[env["ANDROID_NDK_ROOT"] +"/sources/cxx-stl/llvm-libc++/libs/" + arch_subpath + "/libc++_shared.so"])
else:
env.Append(LINKFLAGS=['-shared', '--sysroot=' + lib_sysroot, '-Wl,--warn-shared-textrel'])
if mt_link:
Expand Down
2 changes: 1 addition & 1 deletion platform/haiku/detect.py
Original file line number Diff line number Diff line change
Expand Up @@ -150,6 +150,6 @@ def configure(env):
env.Append(CPPPATH=['#platform/haiku'])
env.Append(CPPFLAGS=['-DUNIX_ENABLED', '-DOPENGL_ENABLED', '-DGLES_ENABLED'])
env.Append(CPPFLAGS=['-DMEDIA_KIT_ENABLED'])
# env.Append(CCFLAGS=['-DFREETYPE_ENABLED'])
# env.Append(CPPFLAGS=['-DFREETYPE_ENABLED'])
env.Append(CPPFLAGS=['-DPTHREAD_NO_RENAME']) # TODO: enable when we have pthread_setname_np
env.Append(LIBS=['be', 'game', 'media', 'network', 'bnetapi', 'z', 'GL'])
Loading

0 comments on commit c2a669a

Please sign in to comment.