~ubuntu-branches/ubuntu/saucy/darktable/saucy-proposed

« back to all changes in this revision

Viewing changes to debian/patches/0001-Fixes-the-cmake-for-binary-package-build.patch

  • Committer: Bazaar Package Importer
  • Author(s): David Bremner
  • Date: 2011-04-14 23:42:12 UTC
  • Revision ID: james.westby@ubuntu.com-20110414234212-o5y5smmy8yt3ix13
Tags: 0.8-2
Enable cmake option BINARY_PACKAGE_BUILD, which disables build host
specific optimizations.

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
From 58f9fecb01c7b3f06ec52964e05346ab9be3918d Mon Sep 17 00:00:00 2001
 
2
From: Henrik Andersson <hean01@users.sourceforge.net>
 
3
Date: Fri, 25 Feb 2011 18:13:50 +0100
 
4
Subject: [PATCH] Fixes the cmake for binary package build,
 
5
 default -march=native is used which is wanted on local builds of
 
6
 git source, when building a package -DBINARY_PACKAGE_BUILD=1 should
 
7
 be provided to cmake to use -mtune=generic for generic optimization..
 
8
 
 
9
Cherry picked from  43a36bd44, with conflicts resolved by David Bremner
 
10
---
 
11
 CMakeLists.txt     |    1 +
 
12
 src/CMakeLists.txt |   10 ++++++++--
 
13
 2 files changed, 9 insertions(+), 2 deletions(-)
 
14
 
 
15
diff --git a/CMakeLists.txt b/CMakeLists.txt
 
16
index be4a1ad..d88bcec 100644
 
17
--- a/CMakeLists.txt
 
18
+++ b/CMakeLists.txt
 
19
@@ -11,6 +11,7 @@ option(DONT_INSTALL_GCONF_SCHEMAS "Dont install gconf schemas, usefull for packa
 
20
 option(BUILD_USERMANUAL "Build all the versions of the usermanual." OFF)
 
21
 option(INSTALL_IOP_EXPERIMENTAL "Also install unstable, unfinished, broken, and likely-to-change-soon plugins." OFF)
 
22
 option(INSTALL_IOP_LEGACY "Also install old plugins we want to get rid of." OFF)
 
23
+option(BINARY_PACKAGE_BUILD "Sets march optimization to generic" OFF)
 
24
 
 
25
 #
 
26
 # Set platform defaults...
 
27
diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt
 
28
index 689e1cf..0fb89bf 100644
 
29
--- a/src/CMakeLists.txt
 
30
+++ b/src/CMakeLists.txt
 
31
@@ -208,10 +208,16 @@ if(NOT WIN32)
 
32
   set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -pthread")
 
33
 endif(NOT WIN32)
 
34
 
 
35
-set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -msse2 -mfpmath=sse -march=native -g")
 
36
+if(NOT BINARY_PACKAGE_BUILD)
 
37
+       set(MARCH "-march=native")      
 
38
+else()
 
39
+       set(MARCH "-mtune=generic")
 
40
+endif()
 
41
+
 
42
+set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -msse2 -mfpmath=sse ${MARCH} -g")
 
43
 set(CMAKE_C_FLAGS_RELEASE "${CMAKE_C_FLAGS_RELEASE} -O3 -ffast-math -fexpensive-optimizations")
 
44
 set(CMAKE_C_FLAGS_DEBUG "${CMAKE_C_FLAGS_DEBUG} -O0 -g -D_DEBUG")
 
45
-set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -msse2 -mfpmath=sse -march=native -g")
 
46
+set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -msse2 -mfpmath=sse ${MARCH} -g")
 
47
 set(CMAKE_CXX_FLAGS_RELEASE "${CMAKE_CXX_FLAGS_RELEASE} -O3 -ffast-math -fexpensive-optimizations")
 
48
 set(CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG} -O0 -g -D_DEBUG")
 
49
   
 
50
-- 
 
51
1.7.2.5
 
52