dfb93e88b9
With pkgsrc built packages, the goal is to have the user's compiler optimization flags set by the user using CFLAGS, etc. To that end, the cmake Makefile has subst.mk code to "sed -e 's,-O.,,'" out opt. flags in Modules/Compiler/*.cmake for cmake compiles with the CMAKE_BUILD_TYPE set (e.g. to Release). Unfortunately, this sed-based approach has two drawbacks: First, it gets applied to packages build with cmake outside of pkgsrc (changing the semantics of -DCMAKE_BUILD_TYPE=Release in an unexpected way by remove -O flags from it). Second, the sed expression damages some of the Modules/Compiler/*.cmake as not all opt flags match the "-O." regular expression. To address this we: 1. remove the subst.mk sed operation on Modules/Compiler/*.cmake 2. add a new config variable CMAKE_PKGSRC_BUILD_FLAGS that should be set for pkgsrc-based cmake builds (e.g. in mk/configure/cmake.mk) 3. we add a patch for Modules/Compiler/GNU.cmake to look for CMAKE_PKGSRC_BUILD_FLAGS and choose a set of non-opt compiler flags when this is set (to provide the desired behavior under pksrc). note that the GNU.cmake file is also used by clang. We can make the corresponding changes to other compilers if desired. The result is that cmake compiles under pkgsrc set CMAKE_PKGSRC_BUILD_FLAGS and follow CFLAGS, etc. (bypassing CMAKE_BUILD_TYPE), but cmake compiles outside of pkgsrc follow the standard cmake semantics for CMAKE_BUILD_TYPE. Also, we no longer damage Modules/Compiler/*.cmake with sed. |
||
---|---|---|
.. | ||
patch-bootstrap | ||
patch-CMakeLists.txt | ||
patch-Modules_Compiler_GNU.cmake | ||
patch-Modules_FindCurses.cmake | ||
patch-Modules_FindPythonInterp.cmake | ||
patch-Modules_FindPythonLibs.cmake | ||
patch-Modules_FindX11.cmake | ||
patch-Modules_Platform_UnixPaths.cmake | ||
patch-Source_CursesDialog_ccmake.cxx | ||
patch-Utilities_KWIML_CMakeLists.txt |