forked from soutade/libgourou
Compare commits
4 Commits
8f0341d0bd
...
e4cd74e741
| Author | SHA1 | Date | |
|---|---|---|---|
| e4cd74e741 | |||
| a7cfd3ef89 | |||
| 772abdd2f9 | |||
| 1605656c73 |
13
Makefile
13
Makefile
@@ -12,6 +12,8 @@ LDFLAGS = -lpugixml
|
||||
|
||||
VERSION := $(shell cat include/libgourou.h |grep LIBGOUROU_VERSION|cut -d '"' -f2)
|
||||
|
||||
UNAME := $(shell uname)
|
||||
|
||||
BUILD_STATIC ?= 0
|
||||
BUILD_SHARED ?= 1
|
||||
BUILD_UTILS ?= 1
|
||||
@@ -27,9 +29,14 @@ ifneq ($(BUILD_STATIC), 0)
|
||||
STATIC_UTILS=1
|
||||
endif
|
||||
ifneq ($(BUILD_SHARED), 0)
|
||||
ifeq ($(UNAME), Darwin)
|
||||
TARGETS += libgourou.dylib
|
||||
TARGET_LIBRARIES += libgourou.dylib libgourou.dylib.$(VERSION)
|
||||
else
|
||||
TARGETS += libgourou.so
|
||||
TARGET_LIBRARIES += libgourou.so libgourou.so.$(VERSION)
|
||||
endif
|
||||
endif
|
||||
ifneq ($(BUILD_UTILS), 0)
|
||||
TARGETS += build_utils
|
||||
endif
|
||||
@@ -82,6 +89,12 @@ libgourou.so.$(VERSION): $(OBJECTS) $(UPDFPARSERLIB)
|
||||
libgourou.so: libgourou.so.$(VERSION)
|
||||
ln -f -s $^ $@
|
||||
|
||||
libgourou.dylib.$(VERSION): $(OBJECTS) $(UPDFPARSERLIB)
|
||||
$(CXX) $^ $(LDFLAGS) -o $@ -shared
|
||||
|
||||
libgourou.dylib: libgourou.dylib.$(VERSION)
|
||||
ln -f -s $^ $@
|
||||
|
||||
build_utils: $(TARGET_LIBRARIES)
|
||||
$(MAKE) -C utils ROOT=$(PWD) CXX=$(CXX) AR=$(AR) DEBUG=$(DEBUG) STATIC_UTILS=$(STATIC_UTILS) DESTDIR=$(DESTDIR) PREFIX=$(PREFIX)
|
||||
|
||||
|
||||
@@ -165,8 +165,8 @@ namespace gourou
|
||||
Exception(const Exception& other)
|
||||
{
|
||||
this->code = other.code;
|
||||
this->line = line;
|
||||
this->file = file;
|
||||
this->line = other.line;
|
||||
this->file = other.file;
|
||||
this->fullmessage = strdup(other.fullmessage);
|
||||
}
|
||||
|
||||
@@ -181,7 +181,7 @@ namespace gourou
|
||||
|
||||
private:
|
||||
int code, line;
|
||||
const char* message, *file;
|
||||
const char* file;
|
||||
char* fullmessage;
|
||||
};
|
||||
|
||||
|
||||
@@ -202,7 +202,7 @@ namespace gourou
|
||||
char* tmp = new char[_length*2+1];
|
||||
|
||||
for(int i=0; i<(int)_length; i++)
|
||||
sprintf(&tmp[i*2], "%02x", _data[i]);
|
||||
snprintf(&tmp[i*2], (_length-i)*2+1, "%02x", _data[i]);
|
||||
|
||||
tmp[_length*2] = 0;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user