change back, using protobuf via conan and compile protoc in seperat step, first working version (compiling)

This commit is contained in:
einhornimmond 2021-02-10 13:29:47 +01:00 committed by Ulf Gebhardt
parent feab9a99fa
commit 425a2beb9f
No known key found for this signature in database
GPG Key ID: 81308EFE29ABFEBD
3 changed files with 28 additions and 21 deletions

View File

@ -119,8 +119,6 @@ set(CMAKE_CXX_FLAGS "/MP /EHsc")
#set(CMAKE_CXX_FLAGS_RELEASE "-O3")
else()
find_package(Protobuf REQUIRED)
include_directories(${Protobuf_INCLUDE_DIRS})
find_library(IROHA_ED25519 ed25519 PATHS "dependencies/iroha-ed25519/build" REQUIRED)
# set vars for mariadb cmake files
@ -143,7 +141,7 @@ if(WIN32)
TARGET_LINK_LIBRARIES(Gradido_LoginServer optimized ${MYSQL_LIBRARIES} Shlwapi)
TARGET_LINK_LIBRARIES(Gradido_LoginServer debug ${COMPILED_MARIADB_CLIENT_DEBUG} Shlwapi)
else()
target_link_libraries(Gradido_LoginServer libmariadb ${Protobuf_LIBRARIES} -pthread)
target_link_libraries(Gradido_LoginServer libmariadb -pthread)
endif()
# install
@ -173,7 +171,7 @@ if(WIN32)
TARGET_LINK_LIBRARIES(Gradido_LoginServer_Test optimized ${MYSQL_LIBRARIES} Shlwapi)
TARGET_LINK_LIBRARIES(Gradido_LoginServer_Test debug ${COMPILED_MARIADB_CLIENT_DEBUG} Shlwapi)
else()
target_link_libraries(Gradido_LoginServer_Test libmariadb ${Protobuf_LIBRARIES} -pthread)
target_link_libraries(Gradido_LoginServer_Test libmariadb -pthread)
endif()
add_test(NAME main COMMAND Gradido_LoginServer_Test)

View File

@ -1,3 +1,16 @@
# Build protoc
FROM gcc:7.5 as protoc_build
RUN git clone --recurse-submodules https://github.com/protocolbuffers/protobuf.git
WORKDIR /protobuf
RUN git checkout v3.9.1
RUN ./autogen.sh
RUN ./configure --enable-static=yes
RUN make -j$(grep processor /proc/cpuinfo | wc -l)
RUN make check
CMD ["./protobuf"]
# Build
From conanio/gcc7 as build
@ -5,26 +18,21 @@ From conanio/gcc7 as build
ENV DOCKER_WORKDIR="/code"
USER root
RUN apt-get update && \
apt-get install -y --no-install-recommends protobuf-compiler libprotobuf-dev && \
apt-get autoclean && \
apt-get autoremove && \
apt-get clean && \
rm -rf /var/lib/apt/lists/*
#RUN apt-get update && \
# apt-get install -y --no-install-recommends protobuf-compiler libprotobuf-dev && \
# apt-get autoclean && \
# apt-get autoremove && \
# apt-get clean && \
# rm -rf /var/lib/apt/lists/*
#RUN grep processor /proc/cpuinfo | wc -l
#RUN mkdir -p "/helper"
#WORKDIR "/helper"
#RUN git clone --recurse-submodules https://github.com/protocolbuffers/protobuf.git
#RUN cd protobuf && \
#git checkout v3.14.0 && \
#./autogen.sh && \
#./configure && \
#make -j$(grep processor /proc/cpuinfo | wc -l) && \
#make check && \
#make install && \
#ldconfig
COPY --from=protoc_build /protobuf/src/.libs/protoc /usr/bin/
COPY --from=protoc_build /protobuf/src/.libs/libprotobuf.so.20.0.1 /usr/lib/libprotobuf.so.20
COPY --from=protoc_build /protobuf/src/.libs/libprotoc.so.20.0.1 /usr/lib/libprotoc.so.20
COPY --from=protoc_build /protobuf/src/google/protobuf/*.proto /usr/include/google/protobuf/
COPY --from=protoc_build /protobuf/src/google/protobuf/*.h /usr/include/google/protobuf/
RUN mkdir -p ${DOCKER_WORKDIR}
WORKDIR ${DOCKER_WORKDIR}

View File

@ -1,6 +1,7 @@
[requires]
Poco/1.9.4@pocoproject/stable
libsodium/1.0.18@bincrafters/stable
protobuf/3.9.1@bincrafters/stable
boost/1.71.0@conan/stable
gtest/1.8.1@bincrafters/stable