mirror of
https://github.com/kotatogram/kotatogram-desktop
synced 2025-09-02 15:45:12 +00:00
Add switch for LTO in Docker image
This commit is contained in:
2
.github/workflows/docker.yml
vendored
2
.github/workflows/docker.yml
vendored
@@ -31,7 +31,7 @@ jobs:
|
|||||||
run: |
|
run: |
|
||||||
cd Telegram/build/docker/centos_env
|
cd Telegram/build/docker/centos_env
|
||||||
poetry install
|
poetry install
|
||||||
DEBUG= poetry run gen_dockerfile | docker buildx build -t $IMAGE_TAG -
|
DEBUG= LTO= poetry run gen_dockerfile | docker buildx build -t $IMAGE_TAG -
|
||||||
|
|
||||||
- name: Push the Docker image.
|
- name: Push the Docker image.
|
||||||
if: ${{ github.ref_name == github.event.repository.default_branch }}
|
if: ${{ github.ref_name == github.event.repository.default_branch }}
|
||||||
|
@@ -44,10 +44,12 @@ RUN mkdir /opt/cmake \
|
|||||||
&& rm {{ CMAKE_FILE }}
|
&& rm {{ CMAKE_FILE }}
|
||||||
|
|
||||||
FROM builder-base AS builder
|
FROM builder-base AS builder
|
||||||
|
{%- if LTO %}
|
||||||
ENV AR gcc-ar
|
ENV AR gcc-ar
|
||||||
ENV RANLIB gcc-ranlib
|
ENV RANLIB gcc-ranlib
|
||||||
ENV NM gcc-nm
|
ENV NM gcc-nm
|
||||||
ENV CFLAGS {% if DEBUG %}-g{% endif %} -Ofast {% if DEBUG %}-flto=auto -ffat-lto-objects{% endif %} -pipe -fPIC -fstack-protector-all -fstack-clash-protection -DNDEBUG -D_FORTIFY_SOURCE=2 -D_GLIBCXX_ASSERTIONS
|
{%- endif %}
|
||||||
|
ENV CFLAGS {% if DEBUG %}-g{% endif %} -Ofast {% if LTO %}-flto=auto -ffat-lto-objects{% endif %} -pipe -fPIC -fstack-protector-all -fstack-clash-protection -DNDEBUG -D_FORTIFY_SOURCE=2 -D_GLIBCXX_ASSERTIONS
|
||||||
ENV CXXFLAGS $CFLAGS
|
ENV CXXFLAGS $CFLAGS
|
||||||
|
|
||||||
FROM builder AS patches
|
FROM builder AS patches
|
||||||
|
@@ -5,7 +5,8 @@ from jinja2 import Environment, FileSystemLoader
|
|||||||
|
|
||||||
def main():
|
def main():
|
||||||
print(Environment(loader=FileSystemLoader(dirname(__file__))).get_template("Dockerfile").render(
|
print(Environment(loader=FileSystemLoader(dirname(__file__))).get_template("Dockerfile").render(
|
||||||
DEBUG=bool(len(environ["DEBUG"])) if "DEBUG" in environ else True
|
DEBUG=bool(len(environ["DEBUG"])) if "DEBUG" in environ else True,
|
||||||
|
LTO=bool(len(environ["LTO"])) if "LTO" in environ else True,
|
||||||
))
|
))
|
||||||
|
|
||||||
if __name__ == '__main__':
|
if __name__ == '__main__':
|
||||||
|
Reference in New Issue
Block a user