Compiles and removed unnecessary deps in Dockerfile

This commit is contained in:
30hours 2024-01-02 02:52:58 +00:00
parent 896844edae
commit a78a1a2f3c
5 changed files with 158 additions and 155 deletions

View file

@ -1,3 +1,5 @@
# TODO: update devcontainer with vcpkg manifest
# ubuntu-22.04 by default # ubuntu-22.04 by default
ARG VARIANT="jammy" ARG VARIANT="jammy"
FROM mcr.microsoft.com/vscode/devcontainers/cpp:0-${VARIANT} FROM mcr.microsoft.com/vscode/devcontainers/cpp:0-${VARIANT}

1
.devcontainer/README.md Normal file
View file

@ -0,0 +1 @@
# todo: write readme on using devcontainer with dev-release

View file

@ -9,14 +9,13 @@ include(CTest)
find_package(Threads REQUIRED) find_package(Threads REQUIRED)
find_package(asio CONFIG REQUIRED) find_package(asio CONFIG REQUIRED)
#find_package(rapidjson CONFIG REQUIRED)
find_path(RAPIDJSON_INCLUDE_DIRS "rapidjson/allocators.h") find_path(RAPIDJSON_INCLUDE_DIRS "rapidjson/allocators.h")
find_package(ryml CONFIG REQUIRED) find_package(ryml CONFIG REQUIRED)
find_package(httplib CONFIG REQUIRED) find_package(httplib CONFIG REQUIRED)
find_package(Armadillo CONFIG REQUIRED) find_package(Armadillo CONFIG REQUIRED)
find_package(Catch2 CONFIG REQUIRED) find_package(Catch2 CONFIG REQUIRED)
# TODO: When release CI is finished, don't use these dirs, install target should go to prod # TODO: when release CI is finished, don't use these dirs, install target should go to prod
SET (PROJECT_ROOT "${PROJECT_SOURCE_DIR}") SET (PROJECT_ROOT "${PROJECT_SOURCE_DIR}")
SET (CMAKE_RUNTIME_OUTPUT_DIRECTORY "${PROJECT_ROOT}/bin") SET (CMAKE_RUNTIME_OUTPUT_DIRECTORY "${PROJECT_ROOT}/bin")
SET (PROJECT_BINARY_TEST_DIR "${PROJECT_ROOT}/bin/test") SET (PROJECT_BINARY_TEST_DIR "${PROJECT_ROOT}/bin/test")
@ -24,10 +23,10 @@ SET (PROJECT_BINARY_TEST_DIR "${PROJECT_ROOT}/bin/test")
MESSAGE ("Binary path: ${PROJECT_BINARY_DIR}") MESSAGE ("Binary path: ${PROJECT_BINARY_DIR}")
MESSAGE ("Binary test path: ${PROJECT_BINARY_TEST_DIR}") MESSAGE ("Binary test path: ${PROJECT_BINARY_TEST_DIR}")
# Include from top-level src dir # include from top-level src dir
include_directories(src) include_directories(src)
# TODO: Create FindSdrplay.cmake for this # TODO: create FindSdrplay.cmake for this
add_library(sdrplay /usr/local/include/sdrplay_api.h) add_library(sdrplay /usr/local/include/sdrplay_api.h)
set_target_properties(sdrplay PROPERTIES LINKER_LANGUAGE C) set_target_properties(sdrplay PROPERTIES LINKER_LANGUAGE C)
target_link_libraries(sdrplay PUBLIC /usr/local/lib/libsdrplay_api.so.3.07) target_link_libraries(sdrplay PUBLIC /usr/local/lib/libsdrplay_api.so.3.07)
@ -51,10 +50,8 @@ add_executable(blah2
src/data/meta/Timing.cpp src/data/meta/Timing.cpp
) )
target_link_libraries(blah2 PRIVATE target_link_libraries(blah2 PRIVATE
Threads::Threads Threads::Threads
rapidjson
asio::asio asio::asio
ryml::ryml ryml::ryml
httplib::httplib httplib::httplib
@ -63,7 +60,7 @@ target_link_libraries(blah2 PRIVATE
fftw3_threads fftw3_threads
sdrplay sdrplay
) )
#target_include_directories(main PRIVATE ${RAPIDJSON_INCLUDE_DIRS}) target_include_directories(blah2 PRIVATE RAPIDJSON_INCLUDE_DIRS "rapidjson/allocators.h")
# unit tests # unit tests
add_executable(testAmbiguity add_executable(testAmbiguity

View file

@ -87,45 +87,45 @@
} }
}, },
{ {
"name": "dev-unix-release", "name": "dev-debug",
"installDir": "$env{HOME}/.local",
"inherits": [
"ci-unix",
"ci-release"
]
},
{
"name": "dev-unix-debug",
"inherits": [ "inherits": [
"ci-unix", "ci-unix",
"ci-debug" "ci-debug"
] ]
}, },
{ {
"name": "dev-unix-release-sa", "name": "dev-release",
"inherits": [ "inherits": [
"ci-unix", "ci-unix",
"ci-release", "ci-release",
"clang-tidy" "clang-tidy"
] ]
},
{
"name": "prod-release",
"installDir": "$env{HOME}/.local",
"inherits": [
"ci-unix",
"ci-release"
]
} }
], ],
"buildPresets": [ "buildPresets": [
{ {
"name": "dev-unix-debug", "name": "dev-debug",
"configurePreset": "dev-unix-debug", "configurePreset": "dev-debug",
"configuration": "Debug", "configuration": "Debug",
"jobs": 4 "jobs": 4
}, },
{ {
"name": "dev-unix-release", "name": "dev-release",
"configurePreset": "dev-unix-release", "configurePreset": "dev-release",
"configuration": "Release", "configuration": "Release",
"jobs": 4 "jobs": 4
}, },
{ {
"name": "dev-unix-release-sa", "name": "prod-release",
"configurePreset": "dev-unix-release-sa", "configurePreset": "prod-release",
"configuration": "Release", "configuration": "Release",
"jobs": 4 "jobs": 4
} }
@ -133,7 +133,7 @@
"testPresets": [ "testPresets": [
{ {
"name": "test-all-unix-release", "name": "test-all-unix-release",
"configurePreset": "dev-unix-release", "configurePreset": "prod-release",
"output": { "output": {
"outputOnFailure": true "outputOnFailure": true
}, },

View file

@ -5,7 +5,10 @@ WORKDIR /blah2
ADD lib lib ADD lib lib
RUN apt-get update \ RUN apt-get update \
&& apt-get install -y g++ make cmake git curl zip unzip doxygen graphviz \ && apt-get install -y g++ make cmake git curl zip unzip doxygen graphviz \
libfftw3-dev liblapack-dev xz-utils libusb-1.0.0-dev pkg-config gfortran libfftw3-dev pkg-config gfortran \
&& apt-get autoremove -y \
&& apt-get clean -y \
&& rm -rf /var/lib/apt/lists/*
# install dependencies from vcpkg # install dependencies from vcpkg
RUN git clone https://github.com/microsoft/vcpkg /opt/vcpkg \ RUN git clone https://github.com/microsoft/vcpkg /opt/vcpkg \
@ -29,7 +32,7 @@ LABEL maintainer="30hours <nathan@30hours.dev>"
ADD src src ADD src src
ADD test test ADD test test
ADD CMakeLists.txt CMakePresets.json /blah2/ ADD CMakeLists.txt CMakePresets.json /blah2/
RUN mkdir -p build && cd build && cmake -S . --preset dev-unix-release \ RUN mkdir -p build && cd build && cmake -S . --preset prod-release \
-DCMAKE_PREFIX_PATH=/blah2/lib/vcpkg_installed/x64-linux/share .. \ -DCMAKE_PREFIX_PATH=/blah2/lib/vcpkg_installed/x64-linux/share .. \
&& cd dev-unix-release && make && cd prod-release && make
RUN chmod +x bin/blah2 RUN chmod +x bin/blah2