This should also fix the observed compilation problems of other ports To honor configure.optflags and configure.cppflags can be simplified as other language-specificįlags were already forwarded correctly to CMake via the above Therefore, the previously proposed modification of the CMake PortGroup Mentions it only briefly in Section 2.7 "Specifying the Compiler toĬMake" and the end of Appendix A - but you have to know what you're Theīook "Mastering CMake" (4th edition) by Ken Martin and Bill Hoffmann Honored by CMake upon its first call in a new build directory. Unfortunately, the modification to the CMake PortGroup proposed by this ticket have broken other ports using CMake to configure its sources for the build phase.Īll that the environment variables CFLAGS, CXXFLAGS, and LDFLAGS get I don't have commit rights to apply these changes to the MacPorts SVN. Please have a look on it and test it with the ports, which motivated the change in r110069 in the first place. The port author has to setĬonfigure.optflags to "-O0" to turn off optimization. Be aware that configure.cflags andĬonfigure.cxxflags contain configure.optflags by default, which are These variablesĪre set to "-g" plus the respective configure.cflags andĬonfigure.cxxflags. The CMAKE_BUILD_TYPE "Debug" uses CMAKE_C_FLAGS_DEBUG andĬMAKE_CXX_FLAGS_DEBUG to specify the compiler flags. ConferĠĬonsider the configure.cflags and configure.cxxflags for +debug variant of the CMake PortsGroup. Optimization, as KDE leaves it on for the "Debug" build type. Support for a build type called "DebugFull", which turns off Only KDE provides in its CMake build infrastructure Instead, CMake provides the build type "Debug" for "debugFull" is not a standard build type in CMake so there are noĭefault compiler flags set for it, which would turn on the inclusion This patch does not fix the issue in the case of selecting the +debug variant of the CMake PortGroup for which two additional patches are necessary:Ġ003-Fix-CMake-PortGroup-debug-variant.patchĬhange the CMAKE_BUILD_TYPE to Debug instead of debugFull for the +debug variant in the CMake PortGroup. TODO: Handle the compiler flags specific to Objective-C, Fortran, and These flags when it runs, as they are frequently set internally inĪttention: If the port author wants to be sure that no compiler flagsĪre passed via configure.args to CMake, he has to set manuallyĬonfigure.optflags to "", as it is by default "-O2" and added to all If you want to turn off assertions in release builds!Ī port author has to be aware that a CMake script can always override Therefore, be sure to add "-NDEBUG" to the configure.cflags Optimization flags, as they are set by default to "-O3 Therefore, they are set via the Release flagsĬMAKE_CXX_FLAGS_RELEASE, which would otherwise overrule the The configure.cxxflags contain configure.optflags byĭefault. Therefore, be sure to add "-NDEBUG" to theĬonfigure.cflags if you want to turn off assertions in release builds! Otherwise overrule the optimization flags, as they are set by default They are set via the Release flags CMAKE_C_FLAGS_RELEASE, which would The configure.cflags contain configure.optflags by default. also toĬMake upstream ticket #12928 "CMake silently ignores CPPFLAGS" The compiler flags for all build types (CMAKE_C_FLAGS,ĬMAKE_CXX_FLAGS) are used, as they are usually empty. The configure.cppflags are added to the C/C++ compiler flags as CMakeĭoes not honor separately CPPFLAGS (it uses usually add_definitions()įor that). The configure.cppflags, configure.optflags, configure.cflags,Ĭonfigure.cxxflags, configure.ldflags are handled by setting the Improve the CMake PortGroup so that it handles the configure.*flags. Thus, Release builds are compiled with optimizationĠ002-Improve-CMake-PortGroup-to-handle-the-configure-flags.patch Ports, which are configured by CMake, honor the configure.optflags set This reverts the changes made to the CMake Portfile in r110069 so that Therefore, I had a look to the CMake port group to fix the issue with the following uploaded patches:Ġ001-Fix-the-CMake-port-specific-part-of-ticket-40648.patchįix the CMake-port-specific part of this ticket. As a regular CMake user, I'm also affected by this annoying issue.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |