Skip site navigation (1)Skip section navigation (2)
Date:      Wed,  8 Sep 2010 00:07:20 +0400 (MSD)
From:      Dmitry Marakasov <amdmi3@FreeBSD.org>
To:        FreeBSD-gnats-submit@FreeBSD.org
Subject:   ports/150363: [bsd.cmake.mk] specify default CMAKE_BUILD_TYPE
Message-ID:  <20100907200720.12FBFB84E@hades.panopticon>
Resent-Message-ID: <201009072010.o87KA6TL096824@freefall.freebsd.org>

next in thread | raw e-mail | index | archive | help

>Number:         150363
>Category:       ports
>Synopsis:       [bsd.cmake.mk] specify default CMAKE_BUILD_TYPE
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    freebsd-ports-bugs
>State:          open
>Quarter:        
>Keywords:       
>Date-Required:
>Class:          change-request
>Submitter-Id:   current-users
>Arrival-Date:   Tue Sep 07 20:10:06 UTC 2010
>Closed-Date:
>Last-Modified:
>Originator:     Dmitry Marakasov
>Release:        FreeBSD 8.1-RELEASE i386
>Organization:
>Environment:
System: FreeBSD hades.panopticon 8.1-RELEASE FreeBSD 8.1-RELEASE #0: Fri Jul 30 02:50:28 MSD 2010 root@hades.panopticon:/async/obj/usr/src/sys/HADES i386


>Description:
CMake has many means to affect compilation flags. We use CMAKE_C_FLAGS/CMAKE_CXX_FLAGS to pass our systemwide flags to cmake, however there's CMAKE_BUILD_TYPE knob which allows you to just select typical configuration (debug/release/release with debug info/etc.) with a single setting. We don't use CMAKE_BUILD_TYPE, however many applications change it in their CMakeLists.txt if it is not defined, thus unwanted debugging or optimization flags get into compiler args.

That can be fixed by patching upstream CMakeLists, however I propose a better way - we define our owu build type for which cmake doesn't have default flags. Thus,
- nothing extra to CFLAGS/CXXFLAGS will be passed to compiler
- no patches to upstream CMakeLists.txt will be needed

Build type I've chosen is arguable - just took something similar to CONFIGURE_TARGET.
This probably needs an exp-run, as it may affect software that change CMAKE_BUILD_TYPE itself, but that isn't fixed in the port

>How-To-Repeat:
>Fix:

--- bsd.cmake.mk.patch begins here ---
Index: bsd.cmake.mk
===================================================================
RCS file: /home/amdmi3/projects/freebsd/FreeBSD.cvs/ports/Mk/bsd.cmake.mk,v
retrieving revision 1.8
diff -u -r1.8 bsd.cmake.mk
--- bsd.cmake.mk	31 Mar 2010 18:07:05 -0000	1.8
+++ bsd.cmake.mk	7 Sep 2010 19:58:53 -0000
@@ -12,7 +12,7 @@
 #					Default: not set
 # CMAKE_BUILD_TYPE	- Type of build (cmake predefined build types),
 #					affects on CFLAGS and thus should not be set.
-#					Default: none (which respects CFLAGS)
+#					Default: FreeBSD_portbld (which respects CFLAGS)
 # CMAKE_VERBOSE		- Verbose build
 #					Default: not set
 # CMAKE_OUTSOURCE	- Instruct to perform an out-of-source build
@@ -63,7 +63,7 @@
 INSTALL_WRKSRC=		${CONFIGURE_WRKSRC}
 .endif
 CMAKE_INSTALL_PREFIX?=	${PREFIX}
-CMAKE_BUILD_TYPE?=	#none
+CMAKE_BUILD_TYPE?=	FreeBSD_portbld
 
 #
 # Instruct cmake to compile/link with pthreads
--- bsd.cmake.mk.patch ends here ---

>Release-Note:
>Audit-Trail:
>Unformatted:



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20100907200720.12FBFB84E>