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

« 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-07-12 09:36:46 UTC
  • mfrom: (1.1.1 upstream)
  • Revision ID: james.westby@ubuntu.com-20110712093646-yp9dbxan44dmw15h
Tags: 0.9-1
* New upstream release.
* Remove all patches now upstream; only patch for
  -Wno-error=unused-but-set-variable remains.
* Bump Standards-Version to 3.9.2 (no changes)

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