mirror of
https://github.com/ethereum/solidity
synced 2023-10-03 13:03:40 +00:00
make build concurrency build-time customizable
This commit is contained in:
parent
7546100776
commit
37b5669ec3
@ -12,11 +12,27 @@ RUN ./scripts/install_deps.sh
|
|||||||
#Copy working directory on travis to the image
|
#Copy working directory on travis to the image
|
||||||
COPY / $WORKDIR
|
COPY / $WORKDIR
|
||||||
|
|
||||||
|
# Number of parallel jobs during build
|
||||||
|
# or 0 for auto-computing (max(1, CPU_core_count * 2/3), a greedy value)
|
||||||
|
ARG BUILD_CONCURRENCY="0"
|
||||||
|
|
||||||
#Install dependencies, eliminate annoying warnings
|
#Install dependencies, eliminate annoying warnings
|
||||||
RUN sed -i -E -e 's/include <sys\/poll.h>/include <poll.h>/' /usr/include/boost/asio/detail/socket_types.hpp
|
RUN sed -i -E -e 's/include <sys\/poll.h>/include <poll.h>/' /usr/include/boost/asio/detail/socket_types.hpp
|
||||||
RUN cmake -DCMAKE_BUILD_TYPE=Release -DTESTS=0 -DSOLC_LINK_STATIC=1
|
RUN cmake -DCMAKE_BUILD_TYPE=Release -DTESTS=0 -DSOLC_LINK_STATIC=1
|
||||||
RUN make solc -j$(grep -c ^processor /proc/cpuinfo) && install -s solc/solc /usr/bin
|
RUN make solc \
|
||||||
#RUN strip solc/solc
|
-j$(awk "BEGIN { \
|
||||||
|
if (${BUILD_CONCURRENCY} != 0) { \
|
||||||
|
print(${BUILD_CONCURRENCY}); \
|
||||||
|
} else { \
|
||||||
|
x=($(grep -c ^processor /proc/cpuinfo) * 2/3); \
|
||||||
|
if (x > 1) { \
|
||||||
|
printf(\"%d\n\", x); \
|
||||||
|
} else { \
|
||||||
|
print(1); \
|
||||||
|
} \
|
||||||
|
} \
|
||||||
|
}")
|
||||||
|
RUN strip solc/solc
|
||||||
|
|
||||||
FROM scratch
|
FROM scratch
|
||||||
COPY --from=build /solidity/solc/solc /usr/bin/solc
|
COPY --from=build /solidity/solc/solc /usr/bin/solc
|
||||||
|
Loading…
Reference in New Issue
Block a user