<tfoot id='gcMvi'></tfoot>
      <bdo id='gcMvi'></bdo><ul id='gcMvi'></ul>

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

    1. <small id='gcMvi'></small><noframes id='gcMvi'>

    2. <i id='gcMvi'><tr id='gcMvi'><dt id='gcMvi'><q id='gcMvi'><span id='gcMvi'><b id='gcMvi'><form id='gcMvi'><ins id='gcMvi'></ins><ul id='gcMvi'></ul><sub id='gcMvi'></sub></form><legend id='gcMvi'></legend><bdo id='gcMvi'><pre id='gcMvi'><center id='gcMvi'></center></pre></bdo></b><th id='gcMvi'></th></span></q></dt></tr></i><div id='gcMvi'><tfoot id='gcMvi'></tfoot><dl id='gcMvi'><fieldset id='gcMvi'></fieldset></dl></div>
    3. #ifdef DEBUG 与 CMake 独立于平台

      #ifdef DEBUG with CMake independent from platform(#ifdef DEBUG 与 CMake 独立于平台)
      • <tfoot id='8c31W'></tfoot>

        <small id='8c31W'></small><noframes id='8c31W'>

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

            <bdo id='8c31W'></bdo><ul id='8c31W'></ul>
          • <legend id='8c31W'><style id='8c31W'><dir id='8c31W'><q id='8c31W'></q></dir></style></legend>
                  <tbody id='8c31W'></tbody>
                本文介绍了#ifdef DEBUG 与 CMake 独立于平台的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着跟版网的小编来一起学习吧!

                问题描述

                我正在使用 CMake 在 Windows (Visual Studio) 以及 Linux 机器 (gcc) 上构建我的项目.我想将一些代码标记为仅调试",例如

                I am using CMake for building my projects on Windows (Visual Studio) as well as on Linux machines(gcc). I'd like to mark some code as "debugging only", like with

                #ifdef DEBUG
                //some logging here
                #endif
                

                问题是:CMake调试"构建类型的所有平台上都有哪些编译器定义?DEBUG 好像不存在.(我只想在构建类型为 Debug 时进行日志记录或其他任何操作.)

                The question is: what compiler definition is available on all platforms in the CMake "Debug" build type? DEBUG seems not to exist. (I want to have the logging or whatever only when the build type is Debug.)

                推荐答案

                CMake 默认将 -DNDEBUG 添加到 CMAKE_C_FLAGS_{RELEASE, MINSIZEREL} 中.因此,您可以使用 #ifndef NDEBUG.

                CMake adds -DNDEBUG to the CMAKE_C_FLAGS_{RELEASE, MINSIZEREL} by default. So, you can use #ifndef NDEBUG.

                这篇关于#ifdef DEBUG 与 CMake 独立于平台的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持跟版网!

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

                相关文档推荐

                What is inside .lib file of Static library, Statically linked dynamic library and dynamically linked dynamic library?(静态库、静态链接动态库和动态链接动态库的 .lib 文件里面是什么?)
                How do I load a C DLL from the SXS in Python?(如何从 Python 中的 SXS 加载 C DLL?)
                Can Cython code be compiled to a dll so C++ application can call it?(Cython 代码可以编译成 dll 以便 C++ 应用程序可以调用它吗?)
                Delay Loading DLLs(延迟加载 DLL)
                Throwing C++ exceptions across DLL boundaries(跨 DLL 边界抛出 C++ 异常)
                Loading a dll from a dll?(从 dll 加载 dll?)

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

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

                    <bdo id='n3Edv'></bdo><ul id='n3Edv'></ul>

                  • <tfoot id='n3Edv'></tfoot>
                    <legend id='n3Edv'><style id='n3Edv'><dir id='n3Edv'><q id='n3Edv'></q></dir></style></legend>
                            <tbody id='n3Edv'></tbody>