Skip to content

Commit

Permalink
Use if then else in RUN
Browse files Browse the repository at this point in the history
  • Loading branch information
yohanchatelain committed Apr 18, 2024
1 parent 3e2a88c commit 3fe3da5
Showing 1 changed file with 7 additions and 5 deletions.
12 changes: 7 additions & 5 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -42,14 +42,16 @@ ENV CXX=g++-${GCC_VERSION}
COPY . /build/verificarlo/
WORKDIR /build/verificarlo

ENV FLANG_OPTION $( [[ "$WITH_FLANG" = "flang" ]] && echo "--with-flang" || echo "--without-flang" )

RUN { ./autogen.sh && \
RUN if [ "$WITH_FLANG" = "flang" ]; then \
export FLANG_OPTION="--with-flang"; \
else \
export FLANG_OPTION="--without-flang"; \
fi && \
./autogen.sh && \
./configure \
--with-llvm=$(llvm-config-${LLVM_VERSION} --prefix) \
${FLANG_OPTION} ; } \
|| { cat config.log; exit 1; }

$FLANG_OPTION || { cat config.log; exit 1; }

# Build verificarlo
RUN make && make install
Expand Down

0 comments on commit 3fe3da5

Please sign in to comment.