From 065146ff8a1bb48d90c21bda4c9e9a519deaa89c Mon Sep 17 00:00:00 2001 From: simon987 Date: Sat, 12 Feb 2022 11:12:53 -0500 Subject: [PATCH] Docker fixes --- .dockerignore | 3 ++- CMakeLists.txt | 1 - Dockerfile | 6 +++--- third-party/libscan/CMakeLists.txt | 24 ++++++++++++++++++++---- 4 files changed, 25 insertions(+), 9 deletions(-) diff --git a/.dockerignore b/.dockerignore index 3dcb17f..662b2dd 100644 --- a/.dockerignore +++ b/.dockerignore @@ -27,4 +27,5 @@ sist2 **/ext_libmobi **/ext_libwpd **/core -*.a \ No newline at end of file +*.a +tmp_scan/ \ No newline at end of file diff --git a/CMakeLists.txt b/CMakeLists.txt index 0d630cf..6979015 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -21,7 +21,6 @@ set(ARGPARSE_SHARED off) add_subdirectory(third-party/argparse) add_executable(sist2 - src/main.c src/sist.h src/io/walk.h src/io/walk.c diff --git a/Dockerfile b/Dockerfile index 832da17..e5d76f3 100644 --- a/Dockerfile +++ b/Dockerfile @@ -3,11 +3,11 @@ MAINTAINER simon987 WORKDIR /build/ COPY . . -RUN cmake -DSIST_PLATFORM=x64_linux -DSIST_DEBUG=off -DBUILD_TESTS=off -DCMAKE_TOOLCHAIN_FILE=/vcpkg/scripts/buildsystems/vcpkg.cmake . +RUN cmake -DSIST_PLATFORM=x64_linux -DSIST_DEBUG=on -DBUILD_TESTS=off -DCMAKE_TOOLCHAIN_FILE=/vcpkg/scripts/buildsystems/vcpkg.cmake . RUN make -j$(nproc) -RUN strip sist2 +RUN strip sist2 || mv sist2_debug sist2 -FROM ubuntu:21.10 +FROM --platform="linux/amd64" ubuntu:21.10 RUN apt update && apt install -y curl libasan5 && rm -rf /var/lib/apt/lists/* diff --git a/third-party/libscan/CMakeLists.txt b/third-party/libscan/CMakeLists.txt index 01f2163..1f8ba9e 100644 --- a/third-party/libscan/CMakeLists.txt +++ b/third-party/libscan/CMakeLists.txt @@ -6,10 +6,26 @@ set(CMAKE_C_STANDARD 11) option(BUILD_TESTS "Build tests" on) add_subdirectory(third-party/antiword) -add_compile_definitions( - antiword - NDEBUG -) +if (SIST_DEBUG) + add_compile_definitions( + antiword + DEBUG + ) +else() + add_compile_definitions( + antiword + NDEBUG + ) + target_compile_options( + antiword + PRIVATE + -g + -fstack-protector + -fno-omit-frame-pointer + -fsanitize=address + -fno-inline + ) +endif() add_library( scan