Skip to content

Commit

Permalink
[osx/ios] fixed i386/x86_64 pick for native compile of libsquash and …
Browse files Browse the repository at this point in the history
…texturepacker
  • Loading branch information
davilla committed May 13, 2012
1 parent 9a27da9 commit 240b7a9
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 12 deletions.
8 changes: 2 additions & 6 deletions lib/libsquish/Makefile.in
Original file line number Diff line number Diff line change
Expand Up @@ -24,12 +24,8 @@ ifeq (@USE_TEXTUREPACKER_NATIVE@,1)
NATIVE_LIB=libsquish-native.so
CLEAN_FILES+=$(NATIVE_LIB)

ifeq ($(findstring osx,$(ARCH)),osx)
ifneq (,$(findstring x86_64,$(CXXFLAGS)))
NATIVE_ARCH=-m32
else
NATIVE_ARCH=-m64
endif
ifeq ($(findstring osx,$(ARCH)),osx)
NATIVE_ARCH=$(shell echo $(CXXFLAGS) | grep x86_64 >/dev/null && echo -m64 || echo -m32)
endif

all: $(LIB) $(NATIVE_LIB)
Expand Down
8 changes: 2 additions & 6 deletions tools/TexturePacker/Makefile.in
Original file line number Diff line number Diff line change
Expand Up @@ -13,11 +13,7 @@ ifeq (@USE_TEXTUREPACKER_NATIVE@,1)
NATIVE_ROOT_PATH=@USE_TEXTUREPACKER_NATIVE_ROOT@
ifdef NATIVE_ROOT_PATH
ifeq ($(findstring osx,@ARCH@),osx)
ifneq (,$(findstring x86_64,$(CXXFLAGS)))
CXXFLAGS+= -m32
else
CXXFLAGS+= -m64
endif
NATIVE_ARCH=$(shell echo $(CXXFLAGS) | grep x86_64 >/dev/null && echo -m64 || echo -m32)
endif
CXXFLAGS+= -I$(NATIVE_ROOT_PATH)/include
LIBS += -L$(NATIVE_ROOT_PATH)/lib
Expand Down Expand Up @@ -45,7 +41,7 @@ all: $(TARGET)
ifeq (@USE_TEXTUREPACKER_NATIVE@,1)
# TexturePacker run native on build system, build it with native tools
$(TARGET): $(SRCS)
g++ $(DEFINES) $(CXXFLAGS) $(SRCS) $(LIBS) -o $(TARGET)
g++ $(DEFINES) $(NATIVE_ARCH) $(CXXFLAGS) $(SRCS) $(LIBS) -o $(TARGET)
clean:
rm -f $(TARGET)
else
Expand Down

0 comments on commit 240b7a9

Please sign in to comment.