#
# Copyright 2022 DMetaSoul
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
#     http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
#
ARG DEV_IMAGE
FROM ${DEV_IMAGE} as build_training

COPY . /opt/metaspore-src

RUN cmake -B /opt/metaspore-build-release -S /opt/metaspore-src \
    -DCMAKE_PREFIX_PATH=/opt/vcpkg_installed/x64-linux \
    -DCMAKE_EXPORT_COMPILE_COMMANDS=ON -DCMAKE_BUILD_TYPE=RelWithDebInfo \
    -DENABLE_TESTS=OFF -DBUILD_SERVING_BIN=OFF -DBUILD_TRAIN_PKG=ON
RUN cmake --build /opt/metaspore-build-release --target python_wheel -- -j8
