[SCM] csound/master: Backport cmake fixes
fsateler at users.alioth.debian.org
fsateler at users.alioth.debian.org
Thu Aug 15 00:07:14 UTC 2013
The following commit has been merged in the master branch:
commit f9f4b3c0526b040071a126014c99ab96cf42ea73
Author: Felipe Sateler <fsateler at debian.org>
Date: Wed Aug 14 18:07:02 2013 -0400
Backport cmake fixes
diff --git a/debian/patches/0000-cmake-flags-fixes.patch b/debian/patches/0000-cmake-flags-fixes.patch
new file mode 100644
index 0000000..747fcc8
--- /dev/null
+++ b/debian/patches/0000-cmake-flags-fixes.patch
@@ -0,0 +1,161 @@
+--- a/CMakeLists.txt
++++ b/CMakeLists.txt
+@@ -160,6 +160,11 @@
+ endif()
+ endfunction(add_compiler_flags)
+
++### COMPILER OPTIMIZATION FLAGS
++option(USE_COMPILER_OPTIMIZATIONS "Use the default Csound compiler optimization flags" ON)
++if(USE_COMPILER_OPTIMIZATIONS)
++include(cmake/CompilerOptimizations.cmake)
++endif()
+
+ # Include this after the install path definitions so we can override them here.
+ # Also after function definitions so we can use them there
+@@ -309,7 +314,7 @@
+
+ if(CMAKE_COMPILER_IS_GNUCC OR CMAKE_COMPILER_IS_GNUCXX)
+ add_definitions("-Wno-format")
+- add_compiler_flags("-g")
++ # add_compiler_flags("-g")
+ endif()
+
+
+@@ -340,7 +345,6 @@
+ SET(BUILD_SHARED_LIBS ON)
+
+ ## HEADER/LIBRARY/OTHER CHECKS ##
+-
+ find_package(OpenMP)
+
+ # First, required stuff
+@@ -376,6 +380,12 @@
+
+ # Now, non required library searches #
+
++include(cmake/CheckAtomic.cmake)
++if(HAVE_ATOMIC_BUILTIN)
++ set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -DHAVE_ATOMIC_BUILTIN")
++ set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -DHAVE_ATOMIC_BUILTIN")
++endif()
++
+ find_library(VORBISFILE_LIBRARY vorbisfile)
+ check_include_file(libintl.h LIBINTL_HEADER)
+ check_include_file_cxx(eigen3/Eigen/Dense EIGEN3_HEADER)
+@@ -1005,20 +1015,7 @@
+ endif()
+
+
+-# VL 13.02.2013: I have added this code to make the PUBLIC attribute mean
+-# something on gcc (OSX, LINUX), since we are using it.
+-# see http://gcc.gnu.org/wiki/Visibility
+-
+-if(NOT WIN32)
+-if(CMAKE_C_COMPILER MATCHES "gcc")
+- add_compiler_flags(${libcsound_CFLAGS} -fvisibility=hidden
+- -ffast-math -mfpmath=sse -fomit-frame-pointer TARGETS ${CSOUNDLIB})
+-else()
+- add_compiler_flags(${libcsound_CFLAGS} TARGETS ${CSOUNDLIB})
+-endif()
+-else()
+- add_compiler_flags(${libcsound_CFLAGS} TARGETS ${CSOUNDLIB})
+-endif()
++add_compiler_flags(${libcsound_CFLAGS} TARGETS ${CSOUNDLIB})
+
+ target_link_libraries(${CSOUNDLIB} ${libcsound_LIBS})
+
+--- a/Custom.cmake.ex
++++ b/Custom.cmake.ex
+@@ -2,7 +2,7 @@
+
+ # GLOBAL
+
+-set(CMAKE_BUILD_TYPE "Debug")
++#set(CMAKE_BUILD_TYPE "Debug")
+ set(CMAKE_VERBOSE_MAKEFILE ON)
+ set(BUILD_STATIC_LIBRARY ON)
+ set(USE_OPEN_MP OFF)
+--- /dev/null
++++ b/cmake/CheckAtomic.cmake
+@@ -0,0 +1,13 @@
++
++include(CheckCSourceCompiles)
++
++check_c_source_compiles("
++
++int main() {
++ int val = 0;
++ __sync_lock_test_and_set(&val, 1);
++}
++
++" HAVE_ATOMIC_BUILTIN)
++
++
+--- /dev/null
++++ b/cmake/CompilerOptimizations.cmake
+@@ -0,0 +1,55 @@
++include(CheckCCompilerFlag)
++include(CheckCXXCompilerFlag)
++
++
++check_c_compiler_flag(-ftree-vectorize HAS_TREE_VECTORIZE)
++check_cxx_compiler_flag(-ftree-vectorize HAS_CXX_TREE_VECTORIZE)
++if (HAS_TREE_VECTORISE)
++ set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -ftree-vectorize")
++endif()
++if (HAS_CXX_TREE_VECTORISE)
++ set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -ftree-vectorize")
++endif()
++
++
++check_c_compiler_flag(-ffast-math HAS_FAST_MATH)
++check_cxx_compiler_flag(-ffast-math HAS_CXX_FAST_MATH)
++if (HAS_FAST_MATH)
++ set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -ffast-math")
++endif()
++if (HAS_CXX_FAST_MATH)
++ set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -ffast-math")
++endif()
++
++
++check_c_compiler_flag(-fvisibility=hidden HAS_VISIBILITY_HIDDEN)
++check_cxx_compiler_flag(-fvisibility=hidden HAS_CXX_VISIBILITY_HIDDEN)
++if (HAS_VISIBILITY_HIDDEN)
++ set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -fvisibility=hidden")
++endif()
++if (HAS_CXX_VISBILITY_HIDDEN)
++ set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fvisibility=hidden")
++endif()
++
++if(NOT "${CMAKE_CXX_COMPILER_ID}" STREQUAL "Clang")
++
++check_c_compiler_flag(-mfpmath=sse HAS_FPMATH_SSE)
++check_cxx_compiler_flag(-mfpmath=sse HAS_CXX_FPMATH_SSE)
++ if (HAS_FPMATH_SSE)
++ set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -mfpmath=sse")
++endif()
++if (HAS_CXX_FPMATH_SSE)
++ set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -mfpmath=sse")
++endif()
++
++endif()
++
++
++check_c_compiler_flag(-fomit-frame-pointer HAS_OMIT_FRAME_POINTER)
++check_cxx_compiler_flag(-fomit-frame-pointer HAS_CXX_OMIT_FRAME_POINTER)
++if (HAS_OMIT_FRAME_POINTER)
++ set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -fomit-frame-pointer")
++endif()
++if (HAS_CXX_OMIT_FRAME_POINTER)
++ set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fomit-frame-pointer")
++endif()
+--- a/include/csound.h
++++ b/include/csound.h
+@@ -157,7 +157,6 @@
+ # define PUBLIC __declspec(dllexport)
+ #elif defined(__GNUC__) && (__GNUC__ >= 4) /* && !defined(__MACH__) */
+ # define PUBLIC __attribute__ ( (visibility("default")) )
+-# define HAVE_ATOMIC_BUILTIN
+ #else
+ # define PUBLIC
+ #endif
diff --git a/debian/patches/series b/debian/patches/series
index 48cbb42..b5c3ace 100644
--- a/debian/patches/series
+++ b/debian/patches/series
@@ -1,3 +1,4 @@
+0000-cmake-flags-fixes.patch
2000-avoid-nonfree-scansyn-plugin.diff
2001-lua-link.diff
2004-fix-gettext.diff
--
csound packaging
More information about the pkg-multimedia-commits
mailing list