From b569b39115d8678358dcfab1ce8106597b4bdd8c Mon Sep 17 00:00:00 2001 From: Taro Matsuzawa Date: Fri, 3 Jan 2020 00:10:48 +0900 Subject: [PATCH 1/3] fixes warning in build, allow compile in macOS environment --- Makefile | 3 ++- package.json | 2 +- src/glyphs.cpp | 2 +- 3 files changed, 4 insertions(+), 3 deletions(-) diff --git a/Makefile b/Makefile index 065f488cc..9a58f9d68 100644 --- a/Makefile +++ b/Makefile @@ -11,7 +11,8 @@ default: release npm install --ignore-scripts release: ./node_modules/.bin/node-pre-gyp - V=1 ./node_modules/.bin/node-pre-gyp configure build --error_on_warnings=$(WERROR) --loglevel=error + ./scripts/setup.sh --config local.env + . local.env; V=1 ./node_modules/.bin/node-pre-gyp configure build --error_on_warnings=$(WERROR) --loglevel=error @echo "run 'make clean' for full rebuild" debug: ./node_modules/.bin/node-pre-gyp diff --git a/package.json b/package.json index 16a931d02..c327536de 100644 --- a/package.json +++ b/package.json @@ -43,7 +43,7 @@ "font-inspect": "./bin/font-inspect" }, "scripts": { - "install": "node-pre-gyp install --fallback-to-build=true", + "install": "./scripts/setup.sh --config local.env; . local.env; node-pre-gyp install --fallback-to-build=true", "test": "./node_modules/.bin/tape test/**/*.test.js", "prepublishOnly": "npm ls" }, diff --git a/src/glyphs.cpp b/src/glyphs.cpp index b00b3d418..8847acf90 100644 --- a/src/glyphs.cpp +++ b/src/glyphs.cpp @@ -572,7 +572,7 @@ void RangeAsync(uv_work_t* req) { // direct type conversions, no need for checking or casting glyph_writer.add_uint32(3, glyph.width); glyph_writer.add_uint32(4, glyph.width); - glyph_writer.add_sint32(5, glyph.width); + glyph_writer.add_sint32(5, static_cast(glyph.width)); // conversions requiring checks, for safety and correctness From 1f8f16b1971f4d9f41196bd579f80a0c2af3971b Mon Sep 17 00:00:00 2001 From: Taro Matsuzawa Date: Fri, 3 Jan 2020 00:47:59 +0900 Subject: [PATCH 2/3] fixes for travis-ci error in linux environment --- Makefile | 16 +++++++++++++--- 1 file changed, 13 insertions(+), 3 deletions(-) diff --git a/Makefile b/Makefile index 9a58f9d68..1148c0c67 100644 --- a/Makefile +++ b/Makefile @@ -1,4 +1,5 @@ MODULE_NAME := $(shell node -e "console.log(require('./package.json').binary.module_name)") +OS := $(uname | tr A-Z a-z) # Whether to turn compiler warnings into errors export WERROR ?= false @@ -11,12 +12,21 @@ default: release npm install --ignore-scripts release: ./node_modules/.bin/node-pre-gyp - ./scripts/setup.sh --config local.env - . local.env; V=1 ./node_modules/.bin/node-pre-gyp configure build --error_on_warnings=$(WERROR) --loglevel=error + ifeq($(OS),darwin) + ./scripts/setup.sh --config local.env + . local.env; V=1 ./node_modules/.bin/node-pre-gyp configure build --error_on_warnings=$(WERROR) --loglevel=error + else + V=1 ./node_modules/.bin/node-pre-gyp configure build --error_on_warnings=$(WERROR) --loglevel=error + endif @echo "run 'make clean' for full rebuild" debug: ./node_modules/.bin/node-pre-gyp - V=1 ./node_modules/.bin/node-pre-gyp configure build --error_on_warnings=$(WERROR) --loglevel=error --debug + ifeq($(OS),darwin) + ./scripts/setup.sh --config local.env + . local.env; V=1 ./node_modules/.bin/node-pre-gyp configure build --error_on_warnings=$(WERROR) --loglevel=error --debug + else + V=1 ./node_modules/.bin/node-pre-gyp configure build --error_on_warnings=$(WERROR) --loglevel=error --debug + endif @echo "run 'make clean' for full rebuild" coverage: From 94254a3371b521188ce5eae15a5665985b03f274 Mon Sep 17 00:00:00 2001 From: Taro Matsuzawa Date: Fri, 3 Jan 2020 00:57:09 +0900 Subject: [PATCH 3/3] fix ifeq/else/endif indent --- Makefile | 26 +++++++++++++------------- 1 file changed, 13 insertions(+), 13 deletions(-) diff --git a/Makefile b/Makefile index 1148c0c67..be1fb6f08 100644 --- a/Makefile +++ b/Makefile @@ -1,5 +1,5 @@ MODULE_NAME := $(shell node -e "console.log(require('./package.json').binary.module_name)") -OS := $(uname | tr A-Z a-z) +OS=$(shell uname | tr A-Z a-z) # Whether to turn compiler warnings into errors export WERROR ?= false @@ -12,21 +12,21 @@ default: release npm install --ignore-scripts release: ./node_modules/.bin/node-pre-gyp - ifeq($(OS),darwin) - ./scripts/setup.sh --config local.env - . local.env; V=1 ./node_modules/.bin/node-pre-gyp configure build --error_on_warnings=$(WERROR) --loglevel=error - else - V=1 ./node_modules/.bin/node-pre-gyp configure build --error_on_warnings=$(WERROR) --loglevel=error - endif +ifeq ($(OS),darwin) + ./scripts/setup.sh --config local.env + . local.env; V=1 ./node_modules/.bin/node-pre-gyp configure build --error_on_warnings=$(WERROR) --loglevel=error +else + V=1 ./node_modules/.bin/node-pre-gyp configure build --error_on_warnings=$(WERROR) --loglevel=error +endif @echo "run 'make clean' for full rebuild" debug: ./node_modules/.bin/node-pre-gyp - ifeq($(OS),darwin) - ./scripts/setup.sh --config local.env - . local.env; V=1 ./node_modules/.bin/node-pre-gyp configure build --error_on_warnings=$(WERROR) --loglevel=error --debug - else - V=1 ./node_modules/.bin/node-pre-gyp configure build --error_on_warnings=$(WERROR) --loglevel=error --debug - endif +ifeq ($(OS),darwin) + ./scripts/setup.sh --config local.env + . local.env; V=1 ./node_modules/.bin/node-pre-gyp configure build --error_on_warnings=$(WERROR) --loglevel=error --debug +else + V=1 ./node_modules/.bin/node-pre-gyp configure build --error_on_warnings=$(WERROR) --loglevel=error --debug +endif @echo "run 'make clean' for full rebuild" coverage: