Windows build fixes
This commit is contained in:
@@ -7,6 +7,14 @@ NANOPB_DIR := $(abspath $(dir $(lastword $(MAKEFILE_LIST)))../)
|
|||||||
# Files for the nanopb core
|
# Files for the nanopb core
|
||||||
NANOPB_CORE = $(NANOPB_DIR)/pb_encode.c $(NANOPB_DIR)/pb_decode.c
|
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
|
# Check whether to use binary version of nanopb_generator or the
|
||||||
# system-supplied python interpreter.
|
# system-supplied python interpreter.
|
||||||
ifneq "$(wildcard $(NANOPB_DIR)/generator-bin)" ""
|
ifneq "$(wildcard $(NANOPB_DIR)/generator-bin)" ""
|
||||||
@@ -16,7 +24,7 @@ ifneq "$(wildcard $(NANOPB_DIR)/generator-bin)" ""
|
|||||||
else
|
else
|
||||||
# Source only or git checkout
|
# Source only or git checkout
|
||||||
PROTOC = protoc
|
PROTOC = protoc
|
||||||
ifdef windir
|
ifdef WINDOWS
|
||||||
PROTOC_OPTS = --plugin=protoc-gen-nanopb=$(NANOPB_DIR)/generator/protoc-gen-nanopb.bat
|
PROTOC_OPTS = --plugin=protoc-gen-nanopb=$(NANOPB_DIR)/generator/protoc-gen-nanopb.bat
|
||||||
else
|
else
|
||||||
PROTOC_OPTS = --plugin=protoc-gen-nanopb=$(NANOPB_DIR)/generator/protoc-gen-nanopb
|
PROTOC_OPTS = --plugin=protoc-gen-nanopb=$(NANOPB_DIR)/generator/protoc-gen-nanopb
|
||||||
|
|||||||
@@ -1,3 +1,4 @@
|
|||||||
|
@echo off
|
||||||
:: This file is used to invoke nanopb_generator.py as a plugin
|
:: This file is used to invoke nanopb_generator.py as a plugin
|
||||||
:: to protoc on Windows.
|
:: to protoc on Windows.
|
||||||
:: Use it like this:
|
:: Use it like this:
|
||||||
|
|||||||
Reference in New Issue
Block a user