Add support for MacOS
This commit is contained in:
Родитель
7c1c861fb0
Коммит
9efe578270
14
.travis.yml
14
.travis.yml
|
@ -1,5 +1,3 @@
|
|||
dist: trusty
|
||||
sudo: false
|
||||
language: node_js
|
||||
|
||||
node_js:
|
||||
|
@ -7,6 +5,13 @@ node_js:
|
|||
- "9"
|
||||
- "10"
|
||||
|
||||
dist: trusty
|
||||
sudo: false
|
||||
osx_image: xcode9.4
|
||||
os:
|
||||
- linux
|
||||
- osx
|
||||
|
||||
# Need to support c++17
|
||||
addons:
|
||||
apt:
|
||||
|
@ -14,8 +19,6 @@ addons:
|
|||
- ubuntu-toolchain-r-test
|
||||
packages:
|
||||
- g++-7
|
||||
env:
|
||||
- CXX=g++-7
|
||||
|
||||
branches:
|
||||
only:
|
||||
|
@ -23,6 +26,9 @@ branches:
|
|||
# For tags
|
||||
- /^[0-9]+\.[0-9]+\.[0-9]+$/
|
||||
|
||||
before_install:
|
||||
- if [[ "$TRAVIS_OS_NAME" == "linux" ]]; then export CXX=g++-7 CC=gcc-7; fi
|
||||
|
||||
# Install scripts (runs after repo cloning).
|
||||
install:
|
||||
- npm install --build-from-source
|
||||
|
|
|
@ -23,6 +23,8 @@ This repository consists of TypeScript and native dependencies built with `node-
|
|||
|
||||
For first time building remember to `npm install`
|
||||
|
||||
This repository uses git submodules. If paths are outdated or non-existent run `git submodule update --init --recursive`
|
||||
|
||||
## Install
|
||||
To install from NPM
|
||||
```
|
||||
|
|
40
binding.gyp
40
binding.gyp
|
@ -12,6 +12,7 @@
|
|||
"-std=gnu++0x",
|
||||
"-std=gnu++1y",
|
||||
"-fno-exceptions",
|
||||
"-fno-rtti",
|
||||
],
|
||||
"cflags!": [
|
||||
"-Wall",
|
||||
|
@ -29,7 +30,8 @@
|
|||
],
|
||||
},
|
||||
},
|
||||
# To disable default flags, windows has to override starting from the configurations
|
||||
# To disable default flags for macOS, see each target, "target_defaults" didn't seem to override.
|
||||
# To disable default flags, windows has to override starting from the configurations.
|
||||
"configurations": {
|
||||
"Release": {
|
||||
"msvs_settings": {
|
||||
|
@ -70,6 +72,19 @@
|
|||
"src/maluuba/speech/nodejs/phone/phone.cpp",
|
||||
"src/maluuba/speech/nodejs/stringdistance/stringdistance.cpp",
|
||||
],
|
||||
"xcode_settings": {
|
||||
"CLANG_CXX_LANGUAGE_STANDARD": "c++17",
|
||||
"GCC_ENABLE_CPP_EXCEPTIONS": "YES", # remove -fno-exceptions
|
||||
"GCC_ENABLE_CPP_RTTI": "YES", # remove -fno-rtti
|
||||
"OTHER_CFLAGS+": [
|
||||
"-Wall",
|
||||
"-pedantic",
|
||||
],
|
||||
"WARNING_CFLAGS!": [
|
||||
"-Wall",
|
||||
"-Wextra",
|
||||
],
|
||||
},
|
||||
},
|
||||
{
|
||||
"target_name": "maluubaspeech-source",
|
||||
|
@ -90,6 +105,19 @@
|
|||
"src/maluuba/speech/pronunciation/pronunciation.cpp",
|
||||
"src/maluuba/unicode/unicode.cpp",
|
||||
],
|
||||
"xcode_settings": {
|
||||
"CLANG_CXX_LANGUAGE_STANDARD": "c++17",
|
||||
"GCC_ENABLE_CPP_EXCEPTIONS": "YES", # remove -fno-exceptions
|
||||
"GCC_ENABLE_CPP_RTTI": "YES", # remove -fno-rtti
|
||||
"OTHER_CFLAGS+": [
|
||||
"-Wall",
|
||||
"-pedantic",
|
||||
],
|
||||
"WARNING_CFLAGS!": [
|
||||
"-Wall",
|
||||
"-Wextra",
|
||||
],
|
||||
},
|
||||
},
|
||||
{
|
||||
"target_name": "flite",
|
||||
|
@ -214,6 +242,16 @@
|
|||
"src/flite/src/wavesynth/cst_sts.c",
|
||||
"src/flite/src/wavesynth/cst_units.c",
|
||||
],
|
||||
"xcode_settings": {
|
||||
"WARNING_CFLAGS!": [
|
||||
"-Wall",
|
||||
"-Wextra",
|
||||
],
|
||||
"OTHER_CFLAGS+": [
|
||||
"-Wno-sign-compare",
|
||||
"-Wno-absolute-value",
|
||||
],
|
||||
},
|
||||
"conditions": [
|
||||
["OS=='win'", {
|
||||
"defines": [
|
||||
|
|
|
@ -116,7 +116,7 @@ namespace nodejs
|
|||
value = arg_extract->Call(v8::Null(isolate), argc, argv);
|
||||
}
|
||||
std::string phrase{*v8::String::Utf8Value{isolate, value}};
|
||||
targets.emplace_back(NodeJsTarget(isolate, obj), phrase, std::move(pronouncer.pronounce(phrase)));
|
||||
targets.emplace_back(NodeJsTarget(isolate, obj), phrase, pronouncer.pronounce(phrase));
|
||||
}
|
||||
|
||||
// copy out the native distance component.
|
||||
|
@ -185,7 +185,7 @@ namespace nodejs
|
|||
value = arg_extract->Call(v8::Null(isolate), argc, argv);
|
||||
}
|
||||
std::string phrase{*v8::String::Utf8Value{isolate, value}};
|
||||
targets.emplace_back(NodeJsTarget(isolate, obj), std::move(pronouncer.pronounce(phrase)));
|
||||
targets.emplace_back(NodeJsTarget(isolate, obj), pronouncer.pronounce(phrase));
|
||||
}
|
||||
|
||||
// copy out the native distance component.
|
||||
|
|
|
@ -10,6 +10,7 @@
|
|||
#define MALUUBA_SPEECH_NODEJS_PERFORMANCE_HPP
|
||||
|
||||
#include <node.h>
|
||||
#include <string>
|
||||
|
||||
namespace maluuba
|
||||
{
|
||||
|
|
|
@ -2,6 +2,7 @@
|
|||
// Licensed under the MIT License.
|
||||
|
||||
#include "maluuba/speech/nodejs/stringdistance.hpp"
|
||||
#include <string>
|
||||
#include <utility>
|
||||
|
||||
namespace maluuba
|
||||
|
|
|
@ -3,7 +3,7 @@
|
|||
|
||||
#ifndef MALUUBA_XTD_OPTIONAL_HPP
|
||||
#define MALUUBA_XTD_OPTIONAL_HPP
|
||||
#if __cplusplus >= 201703L
|
||||
#if __cplusplus >= 201703L && __has_include(<optional>)
|
||||
|
||||
#include <optional>
|
||||
namespace maluuba
|
||||
|
|
Загрузка…
Ссылка в новой задаче