diff options
-rw-r--r-- | BuildTools/SCons/SConstruct | 8 | ||||
-rw-r--r-- | SwifTools/SConscript | 11 | ||||
-rw-r--r-- | SwifTools/SpellCheckerFactory.h | 2 |
3 files changed, 18 insertions, 3 deletions
diff --git a/BuildTools/SCons/SConstruct b/BuildTools/SCons/SConstruct index 2e8d1cb..5b88855 100644 --- a/BuildTools/SCons/SConstruct +++ b/BuildTools/SCons/SConstruct @@ -445,6 +445,14 @@ else : openssl_conf.Finish() +#Hunspell +env["HAVE_HUNSPELL"] = 0; +conf = Configure(conf_env.Clone()) +if conf.CheckLib("hunspell-1.3") : + env["HAVE_HUNSPELL"] = 1 + env["HUNSPELL_FLAGS"] = {"LIBS": ["libhunspell-1.3"]} + + # Bonjour if env["PLATFORM"] == "darwin" : env["HAVE_BONJOUR"] = 1 diff --git a/SwifTools/SConscript b/SwifTools/SConscript index d383317..177438a 100644 --- a/SwifTools/SConscript +++ b/SwifTools/SConscript @@ -7,8 +7,10 @@ Import("env") if env["SCONS_STAGE"] == "flags" : env["SWIFTOOLS_FLAGS"] = { "LIBPATH": [Dir(".")], - "LIBS": ["SwifTools", "libhunspell-1.3"] + "LIBS": ["SwifTools"] } + if env["HAVE_HUNSPELL"] : + env.MergeFlags(env["HUNSPELL_FLAGS"]) ################################################################################ # Build @@ -29,11 +31,18 @@ if env["SCONS_STAGE"] == "build" : "Linkify.cpp", "TabComplete.cpp", "LastLineTracker.cpp", + ] + + if swiftools_env["HAVE_HUNSPELL"] : + swiftools_env.MergeFlags(swiftools_env["HUNSPELL_FLAGS"]) + swiftools_env.Append(CPPDEFINES = ["HAVE_HUNSPELL"]) + sources += [ "SpellCheckerFactory.cpp", "HunspellChecker.cpp", "SpellParser.cpp", ] + if swiftools_env.get("HAVE_SPARKLE", 0) : swiftools_env.MergeFlags(swiftools_env["SPARKLE_FLAGS"]) swiftools_env.Append(CPPDEFINES = ["HAVE_SPARKLE"]) diff --git a/SwifTools/SpellCheckerFactory.h b/SwifTools/SpellCheckerFactory.h index 85aa8b6..d58a9ec 100644 --- a/SwifTools/SpellCheckerFactory.h +++ b/SwifTools/SpellCheckerFactory.h @@ -6,8 +6,6 @@ #pragma once -#define HAVE_HUNSPELL - namespace Swift { class SpellChecker; class SpellCheckerFactory { |