diff options
author | Petteri Aimonen <jpa@git.mail.kapsi.fi> | 2013-11-17 20:37:18 +0200 |
---|---|---|
committer | Petteri Aimonen <jpa@git.mail.kapsi.fi> | 2013-12-29 20:26:57 +0200 |
commit | d7cadaa46fe5979518a7ee2493250434f4e8ee40 (patch) | |
tree | 1d3c16e7033d1fe376207f755c54fb7955bb65cf | |
parent | d344bda28ae7a1a590790e1346a73a5d159ce7dd (diff) |
Windows build fixes
-rw-r--r-- | extra/nanopb.mk | 10 | ||||
-rw-r--r-- | generator/protoc-gen-nanopb.bat | 1 |
2 files changed, 10 insertions, 1 deletions
diff --git a/extra/nanopb.mk b/extra/nanopb.mk index 296f98e2..7576baee 100644 --- a/extra/nanopb.mk +++ b/extra/nanopb.mk @@ -7,6 +7,14 @@ NANOPB_DIR := $(abspath $(dir $(lastword $(MAKEFILE_LIST)))../) # Files for the nanopb core NANOPB_CORE = $(NANOPB_DIR)/pb_encode.c $(NANOPB_DIR)/pb_decode.c +# Check if we are running on Windows +ifdef windir +WINDOWS = 1 +endif +ifdef WINDIR +WINDOWS = 1 +endif + # Check whether to use binary version of nanopb_generator or the # system-supplied python interpreter. ifneq "$(wildcard $(NANOPB_DIR)/generator-bin)" "" @@ -16,7 +24,7 @@ ifneq "$(wildcard $(NANOPB_DIR)/generator-bin)" "" else # Source only or git checkout PROTOC = protoc - ifdef windir + ifdef WINDOWS PROTOC_OPTS = --plugin=protoc-gen-nanopb=$(NANOPB_DIR)/generator/protoc-gen-nanopb.bat else PROTOC_OPTS = --plugin=protoc-gen-nanopb=$(NANOPB_DIR)/generator/protoc-gen-nanopb diff --git a/generator/protoc-gen-nanopb.bat b/generator/protoc-gen-nanopb.bat index f70ca600..3eed057b 100644 --- a/generator/protoc-gen-nanopb.bat +++ b/generator/protoc-gen-nanopb.bat @@ -1,3 +1,4 @@ +@echo off :: This file is used to invoke nanopb_generator.py as a plugin :: to protoc on Windows. :: Use it like this: |