Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion include/espeak
Submodule espeak updated 109 files
32 changes: 19 additions & 13 deletions nvdaHelper/archBuild_sconscript
Original file line number Diff line number Diff line change
Expand Up @@ -93,18 +93,8 @@ env.Append(
]
)
env.Append(CCFLAGS=[
'/W3',
'/WX',
'/std:c++17'
'/std:c++17',
])
if 'analyze' in debug:
env.Append(CCFLAGS=['/analyze'])
# Disable: Inconsistent annotation for 'x': this instance has no annotations.
# Seems all MIDL-generated code from idl files don't add annotations
env.Append(CCFLAGS='/wd28251')
# Disable: 'x': unreferenced formal parameter
# We use a great deal of hook functions where we have no need for various parameters
env.Append(CCFLAGS='/wd4100')

env.Append(CXXFLAGS=['/EHsc'])

Expand Down Expand Up @@ -155,6 +145,22 @@ if 'debugCRT' in debug:
else:
env.Append(CCFLAGS=['/MT'])

# Don't enable warnings and warnings as errors or analysis to 3rd party code.
thirdPartyEnv = env.Clone()
env.Append(CCFLAGS=[
'/W3',
'/WX',
])
if 'analyze' in debug:
env.Append(CCFLAGS=['/analyze'])
# Disable: Inconsistent annotation for 'x': this instance has no annotations.
# Seems all MIDL-generated code from idl files don't add annotations
env.Append(CCFLAGS='/wd28251')
# Disable: 'x': unreferenced formal parameter
# We use a great deal of hook functions where we have no need for various parameters
env.Append(CCFLAGS='/wd4100')

Export('thirdPartyEnv')
Export('env')

acrobatAccessRPCStubs=env.SConscript('acrobatAccess_sconscript')
Expand Down Expand Up @@ -218,5 +224,5 @@ if TARGET_ARCH in ('x86_64', 'arm64'):
env.Install(libInstallDir,remoteLoaderProgram)

if TARGET_ARCH=='x86':
env.SConscript('espeak/sconscript')
env.SConscript('liblouis/sconscript')
thirdPartyEnv.SConscript('espeak/sconscript')
thirdPartyEnv.SConscript('liblouis/sconscript')
13 changes: 4 additions & 9 deletions nvdaHelper/espeak/config.h
Original file line number Diff line number Diff line change
@@ -1,10 +1,5 @@
// general headers and types
#define HAVE_STDINT_H 1
#define __WIN32__ 1
#define LIBESPEAK_NG_EXPORT
// Supplies the "config.h" include for espeak files
// Replaces the include/espeak/src/windows/config.h file

// Espeak features
#define INCLUDE_KLATT 1
#define HAVE_SONIC_H 1

#define PACKAGE_VERSION "1.49.3 dev"
// Preprocessor definitions have been moved to the build system
// See: nvdaHelper/espeak/sconscript
56 changes: 42 additions & 14 deletions nvdaHelper/espeak/sconscript
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
from include.scons.SCons.Util import CLVar

Import([
'env',
'thirdPartyEnv',
'sourceDir',
])

Expand Down Expand Up @@ -30,19 +32,37 @@ class espeak_VOICE(ctypes.Structure):
('spare',ctypes.c_void_p),
]

env=env.Clone()
#Whole-program optimization causes eSpeak to distort and worble with its Klatt4 voice
#Therefore specifically force it off
env.Append(CCFLAGS='/GL-')

# Don't analyze the code as not our project
if 'analyze' in env['nvdaHelperDebugFlags']:
env.Append(CCFLAGS='/analyze-')

# Ignore all warnings as the code is not ours
env.Replace(CCFLAGS='/W0')

env.Append(CPPPATH=['#nvdaHelper/espeak',espeakIncludeDir,espeakIncludeDir.Dir('compat'),sonicSrcDir,espeakSrcDir.Dir('ucd-tools/src/include')])
env = thirdPartyEnv.Clone()
env.Append(
CCFLAGS=[
# Whole-program optimization causes eSpeak to distort and warble with its Klatt4 voice
# Therefore specifically force it off
'/GL-',
# Ignore all warnings as the code is not ours.
'/W0',
# Preprocessor definitions. Migrated from 'nvdaHelper/espeak/config.h'
'/DPACKAGE_VERSION=\\"1.51-dev\\"', # See 'include/espeak/src/windows/config.h'
'/DHAVE_STDINT_H=1',
'/D__WIN32__#1',
'/DLIBESPEAK_NG_EXPORT',
# Define WIN32_LEAN_AND_MEAN for preprocessor to prevent windows.h including winsock causing redefinition
# errors when winsock2 is included by espeak\src\include\compat\endian.h
'/DWIN32_LEAN_AND_MEAN',
# Preprocessor definitions. Espeak Features
'/DINCLUDE_SPEECHPLAYER=1',
'/DINCLUDE_KLATT=1',
'/DHAVE_SONIC_H=1',
])

env.Append(
CPPPATH=[
'#nvdaHelper/espeak', # ensure that nvdaHelper/espeak/config.h is found first.
espeakIncludeDir,
espeakIncludeDir.Dir('compat'),
espeakSrcDir.Dir('speechPlayer/include'),
sonicSrcDir,
espeakSrcDir.Dir('ucd-tools/src/include')
])

def espeak_compilePhonemeData_buildEmitter(target,source,env):
phSourceIgnores=['error_log','error_intonation','compile_prog_log','compile_report','envelopes.png']
Expand Down Expand Up @@ -131,6 +151,14 @@ espeakLib=env.SharedLibrary(
"voices.c",
"wavegen.c",
sonicLib,
# espeak OPT_SPEECHPLAYER block
"sPlayer.c",
"../speechPlayer/src/frame.cpp",
"../speechPlayer/src/speechPlayer.cpp",
"../speechPlayer/src/speechWaveGenerator.cpp",
#"../speak-ng.cpp",
# if not OPT_SPEECHPLAYER
# "../speak-ng.c",
# espeak does not need to handle its own audio output so dont include:
# pcaudiolib\src\audio.c
# pcaudiolib\src\windows.c
Expand Down
10 changes: 7 additions & 3 deletions nvdaHelper/liblouis/sconscript
Original file line number Diff line number Diff line change
Expand Up @@ -16,11 +16,17 @@ import os
import re
import glob
from SCons.Tool.MSCommon.vc import find_vc_pdir
import typing
from include.scons.SCons.Environment import Environment
from include.scons.SCons.Environment import Base

Import([
"env",
"thirdPartyEnv",
"sourceDir",
])
sourceDir:Base = sourceDir
thirdPartyEnv: Environment = thirdPartyEnv
env: Environment = typing.cast(Environment, thirdPartyEnv.Clone())

louisRootDir = env.Dir("#include/liblouis")
louisSourceDir = louisRootDir.Dir("liblouis")
Expand All @@ -37,8 +43,6 @@ def getLouisVersion():
return m.group("version")
return "unknown"

env = env.Clone()

# Liblouis is build with Clang, as Microsoft Visual C++ is unable to build C99 code.
clangDirs = glob.glob(os.path.join(
find_vc_pdir(env, env.get("MSVC_VERSION")),
Expand Down
2 changes: 1 addition & 1 deletion readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@ For reference, the following run time dependencies are included in Git submodule

* [comtypes](https://github.com/enthought/comtypes), version 1.1.7
* [wxPython](https://www.wxpython.org/), version 4.0.3
* [eSpeak NG](https://github.com/espeak-ng/espeak-ng), version 1.51-dev commit 1fb68ffffea4
* [eSpeak NG](https://github.com/espeak-ng/espeak-ng), version 1.51-dev commit 82d5b7b04
* [Sonic](https://github.com/waywardgeek/sonic), commit 4f8c1d11
* [IAccessible2](https://wiki.linuxfoundation.org/accessibility/iaccessible2/start), commit cbc1f29631780
* [ConfigObj](https://github.com/DiffSK/configobj), commit f9a265c
Expand Down