Skip to content

Commit

Permalink
Fix build.
Browse files Browse the repository at this point in the history
  • Loading branch information
Relintai committed Jul 13, 2023
1 parent 1198735 commit a5365f8
Show file tree
Hide file tree
Showing 5 changed files with 20 additions and 35 deletions.
3 changes: 1 addition & 2 deletions modules/mesh_utils/SCsub
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,7 @@ sources = [
"xatlas/xatlas.cpp",
]

if version.major < 4:
sources.append("delaunay/r128.c")
sources.append("delaunay/r128.c")

if ARGUMENTS.get('custom_modules_shared', 'no') == 'yes':
# Shared lib compilation
Expand Down
3 changes: 1 addition & 2 deletions modules/props/SCsub
Original file line number Diff line number Diff line change
Expand Up @@ -47,8 +47,7 @@ sources = [
"material_cache/prop_material_cache.cpp"
]

if version.minor >= 4:
sources.append("props/prop_data_portal.cpp")
sources.append("props/prop_data_portal.cpp")

if env["module_texture_packer_enabled"]:
sources.append("material_cache/prop_material_cache_pcm.cpp")
Expand Down
3 changes: 1 addition & 2 deletions modules/props_2d/SCsub
Original file line number Diff line number Diff line change
Expand Up @@ -46,8 +46,7 @@ sources = [
"material_cache/prop_2d_material_cache.cpp"
]

if version.minor >= 4:
sources.append("props/prop_2d_data_portal.cpp")
sources.append("props/prop_2d_data_portal.cpp")

if env["module_texture_packer_enabled"]:
sources.append("material_cache/prop_2d_material_cache_pcm.cpp")
Expand Down
42 changes: 14 additions & 28 deletions platform/frt/detect.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,21 +5,12 @@

import version

if version.major > 2:
yes = True
no = False
else:
yes = 'yes'
no = 'no'
yes = True
no = False


def has_wrapper_for(lib):

if version.major == 2:
return False
if version.minor > 2:
return True
return False
return True


def is_active():
Expand All @@ -40,11 +31,7 @@ def can_build():


def get_opts():

if version.major > 2:
from SCons.Variables import BoolVariable
else:
def BoolVariable(a,b,c): return (a,b,c)
from SCons.Variables import BoolVariable

return [
('frt_arch', 'Architecture (no/arm32v6/arm32v7/arm64v8)', 'no'),
Expand All @@ -66,10 +53,8 @@ def check(env, key):

if not (key in env):
return False
if version.major > 2:
return env[key]
else:
return env[key] == 'yes'

return env[key]

def configure(env):

Expand Down Expand Up @@ -133,9 +118,8 @@ def configure(env):
if os.system(pkg_config + ' --exists libpulse') == 0:
print('Enabling PulseAudio')
env.Append(CPPDEFINES=['PULSEAUDIO_ENABLED'])
if version.major == 2:
env.ParseConfig(pkg_config + ' --cflags --libs libpulse-simple')
elif has_wrapper_for('libpulse'):

if has_wrapper_for('libpulse'):
env.ParseConfig(pkg_config + ' --cflags libpulse')
else:
env.ParseConfig(pkg_config + ' --cflags --libs libpulse')
Expand All @@ -162,9 +146,10 @@ def configure(env):
env.Append(CCFLAGS=['-O3', '-DDEBUG_ENABLED'])
elif env['target'] == 'debug':
env.Append(CCFLAGS=['-g2', '-DDEBUG_ENABLED', '-DDEBUG_MEMORY_ENABLED'])
if env['target'].startswith('release'):
if version.major == 2 or (version.major == 3 and version.minor == 0):
env.Append(CCFLAGS=['-ffast-math'])

#if env['target'].startswith('release'):
# if version.major == 2 or (version.major == 3 and version.minor == 0):
# env.Append(CCFLAGS=['-ffast-math'])

if env['frt_arch'] == 'arm32v6':
env.Append(CCFLAGS=['-march=armv6', '-mfpu=vfp', '-mfloat-abi=hard'])
Expand All @@ -179,7 +164,8 @@ def configure(env):
#env.Append(CFLAGS=['-std=gnu11']) # for libwebp (maybe more in the future)
env.Append(CPPFLAGS=['-DFRT_ENABLED', '-DUNIX_ENABLED', '-DGLES2_ENABLED', '-DGLES_ENABLED'])
env.Append(LIBS=['pthread'])
if env['frt_arch'] == 'arm32v6' and version.major == 3 and version.minor >= 4: # TODO find out exact combination

if env['frt_arch'] == 'arm32v6':
env.Append(LIBS=['atomic'])

env.Append(FRT_MODULES=['envprobe.cpp'])
Expand Down
4 changes: 3 additions & 1 deletion platform/frt_sdl/detect.py
Original file line number Diff line number Diff line change
Expand Up @@ -91,8 +91,10 @@ def configure_misc(env):
env.Append(CPPFLAGS=['-DFRT_ENABLED'])
#env.Append(CFLAGS=['-std=gnu11']) # for libwebp (maybe more in the future)
env.Append(LIBS=['pthread', 'z', 'dl'])
if env['frt_arch'] == 'arm32v6' and version.minor >= 4: # TODO find out exact combination

if env['frt_arch'] == 'arm32v6':
env.Append(LIBS=['atomic'])

if env['CXX'] == 'clang++':
env['CC'] = 'clang'
env['LD'] = 'clang++'
Expand Down

0 comments on commit a5365f8

Please sign in to comment.