expand support for publishing LZMA artifacts

This commit is contained in:
Joel Dice 2015-04-07 16:55:45 -06:00
parent e60f53db73
commit 8022bd9733
2 changed files with 33 additions and 2 deletions

View File

@ -262,6 +262,20 @@ publishing {
type "a"
extension "a"
}
if (buildOption == "-lzma") {
artifact("${nativeBuildDir}/libavian-lzma.a") {
name "libavian-lzma"
type "a"
extension "a"
}
artifact("${nativeBuildDir}/lzma/lzma") {
name "lzma"
type publishBinSuffix
extension binSuffix
}
}
}
}
}

View File

@ -1409,6 +1409,8 @@ ifneq ($(lzma),)
$(call generator-c-objects,$(lzma-encoder-lzma-sources),$(lzma)/C,$(build))
lzma-loader = $(build)/lzma/load.o
lzma-library = $(build)/libavian-lzma.a
endif
generator-cpp-objects = \
@ -1586,11 +1588,11 @@ test-args = $(test-flags) $(input)
.PHONY: build
ifneq ($(supports_avian_executable),false)
build: $(static-library) $(executable) $(dynamic-library) $(lzma-loader) \
build: $(static-library) $(executable) $(dynamic-library) $(lzma-library) \
$(lzma-encoder) $(executable-dynamic) $(classpath-dep) $(test-dep) \
$(test-extra-dep) $(embed) $(build)/classpath.jar
else
build: $(static-library) $(dynamic-library) $(lzma-loader) \
build: $(static-library) $(dynamic-library) $(lzma-library) \
$(lzma-encoder) $(classpath-dep) $(test-dep) \
$(test-extra-dep) $(embed) $(build)/classpath.jar
endif
@ -1920,6 +1922,21 @@ $(lzma-encoder-objects): $(build)/lzma/%.o: $(src)/lzma/%.cpp
$(lzma-encoder): $(lzma-encoder-objects) $(lzma-encoder-lzma-objects)
$(build-cc) $(^) -g -o $(@)
$(lzma-library): $(lzma-loader) $(lzma-decode-objects)
@echo "creating $(@)"
@rm -rf $(build)/libavian-lzma
@mkdir -p $(build)/libavian-lzma
rm -rf $(@)
for x in $(^); \
do cp $${x} $(build)/libavian-lzma/$$(echo $${x} | sed s:/:_:g); \
done
ifdef ms_cl_compiler
$(ar) $(arflags) $(build)/libavian-lzma/*.o -out:$(@)
else
$(ar) cru $(@) $(build)/libavian-lzma/*.o
$(ranlib) $(@)
endif
$(lzma-loader): $(src)/lzma/load.cpp
$(compile-object)