<legend id='tmbqG'><style id='tmbqG'><dir id='tmbqG'><q id='tmbqG'></q></dir></style></legend>

    <tfoot id='tmbqG'></tfoot>

    <small id='tmbqG'></small><noframes id='tmbqG'>

    • <bdo id='tmbqG'></bdo><ul id='tmbqG'></ul>
    <i id='tmbqG'><tr id='tmbqG'><dt id='tmbqG'><q id='tmbqG'><span id='tmbqG'><b id='tmbqG'><form id='tmbqG'><ins id='tmbqG'></ins><ul id='tmbqG'></ul><sub id='tmbqG'></sub></form><legend id='tmbqG'></legend><bdo id='tmbqG'><pre id='tmbqG'><center id='tmbqG'></center></pre></bdo></b><th id='tmbqG'></th></span></q></dt></tr></i><div id='tmbqG'><tfoot id='tmbqG'></tfoot><dl id='tmbqG'><fieldset id='tmbqG'></fieldset></dl></div>

      1. 如何为条带文件配置 cmake

        How to config cmake for strip file(如何为条带文件配置 cmake)

          <bdo id='nguGj'></bdo><ul id='nguGj'></ul>
          <i id='nguGj'><tr id='nguGj'><dt id='nguGj'><q id='nguGj'><span id='nguGj'><b id='nguGj'><form id='nguGj'><ins id='nguGj'></ins><ul id='nguGj'></ul><sub id='nguGj'></sub></form><legend id='nguGj'></legend><bdo id='nguGj'><pre id='nguGj'><center id='nguGj'></center></pre></bdo></b><th id='nguGj'></th></span></q></dt></tr></i><div id='nguGj'><tfoot id='nguGj'></tfoot><dl id='nguGj'><fieldset id='nguGj'></fieldset></dl></div>

            <tfoot id='nguGj'></tfoot>
              <tbody id='nguGj'></tbody>

                <small id='nguGj'></small><noframes id='nguGj'>

                <legend id='nguGj'><style id='nguGj'><dir id='nguGj'><q id='nguGj'></q></dir></style></legend>
                • 本文介绍了如何为条带文件配置 cmake的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着跟版网的小编来一起学习吧!

                  问题描述

                  当我在发布模式下使用 cmake 时,我有以下二进制文件:

                  when I use cmake in Release mode I have the following binary:

                  64-bit LSB executable, x86-64, version 1 (SYSV), dynamically linked, interpreter /lib64/ld-linux-x86-64.so.2, for GNU/Linux 2.6.32, BuildID[sha1]=485ac09b0a3aa879f88b7f5db6c00ea8d8e1eaf6, not stripped
                  

                  我想剥离二进制文件.我怎么能以干净的方式告诉 cmake 将 -s 选项添加到我的编译器中以使其被剥离?

                  I want the binary to be stripped. How can I say to cmake in a clean way to add the -s option to my compiler to make it stripped?

                  为什么默认发布模式没有剥离我的二进制文件?

                  Why did the Default Release mode not strip my binary?

                  推荐答案

                  最简单的方法是修改CFLAGS或CXXFLAGS(取决于C或C++代码)

                  Cleanest possible way is to modify CFLAGS or CXXFLAGS (depending on C or C++ code)

                  set(CMAKE_C_FLAGS_RELEASE "${CMAKE_C_FLAGS_RELEASE} -s")
                  set(CMAKE_CXX_FLAGS_RELEASE "${CMAKE_CXX_FLAGS_RELEASE} -s")
                  

                  但是如果你不想改变你的构建系统,还有一个技巧(找出在上面放置的确切位置可能会很棘手).您可以将 strip 作为独立应用程序使用,例如:

                  But there is one more hack if you do not want to change your build system (figuring out exact place where to put above lines might be tricky). You may just use strip as standalone application, like:

                  strip -s a.out
                  

                  并在可执行文件准备好作为构建后步骤发布后执行此操作.我发现这种方式更干净,然后扰乱了编译器标志.

                  and do this after executable is ready to release as a post-build step. I found this way cleaner, then disturbing compiler flags.

                  这篇关于如何为条带文件配置 cmake的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持跟版网!

                  本站部分内容来源互联网,如果有图片或者内容侵犯了您的权益,请联系我们,我们会在确认后第一时间进行删除!

                  相关文档推荐

                  Is Type(::x); valid?(是类型(::x);有效的?)
                  Difference between an inline function and static inline function(内联函数和静态内联函数的区别)
                  Compilation fails randomly: quot;cannot open program databasequot;(编译随机失败:“无法打开程序数据库)
                  Too many initializers error for a simple array in bcc32(bcc32 中的简单数组的初始值设定项过多错误)
                  No Member named stoi in namespace std(命名空间 std 中没有名为 stoi 的成员)
                  Error using a constexpr as a template parameter within the same class(在同一个类中使用 constexpr 作为模板参数时出错)
                    <tbody id='cg283'></tbody>

                    1. <tfoot id='cg283'></tfoot>

                        • <i id='cg283'><tr id='cg283'><dt id='cg283'><q id='cg283'><span id='cg283'><b id='cg283'><form id='cg283'><ins id='cg283'></ins><ul id='cg283'></ul><sub id='cg283'></sub></form><legend id='cg283'></legend><bdo id='cg283'><pre id='cg283'><center id='cg283'></center></pre></bdo></b><th id='cg283'></th></span></q></dt></tr></i><div id='cg283'><tfoot id='cg283'></tfoot><dl id='cg283'><fieldset id='cg283'></fieldset></dl></div>
                          • <bdo id='cg283'></bdo><ul id='cg283'></ul>

                            <small id='cg283'></small><noframes id='cg283'>

                            <legend id='cg283'><style id='cg283'><dir id='cg283'><q id='cg283'></q></dir></style></legend>