commit-gnuradio
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Commit-gnuradio] [gnuradio] 06/07: cmake: fixes to cmake for setting fl


From: git
Subject: [Commit-gnuradio] [gnuradio] 06/07: cmake: fixes to cmake for setting flags properly and removing dups.
Date: Sun, 27 Jul 2014 18:06:28 +0000 (UTC)

This is an automated email from the git hooks/post-receive script.

trondeau pushed a commit to branch master
in repository gnuradio.

commit 2ddf0c9508e3f9e22f950cbb82731528b742720e
Author: Tom Rondeau <address@hidden>
Date:   Sat Jul 26 12:19:29 2014 -0400

    cmake: fixes to cmake for setting flags properly and removing dups.
---
 cmake/Modules/GrMiscUtils.cmake |  6 +++++-
 volk/lib/CMakeLists.txt         | 10 +++++-----
 2 files changed, 10 insertions(+), 6 deletions(-)

diff --git a/cmake/Modules/GrMiscUtils.cmake b/cmake/Modules/GrMiscUtils.cmake
index 747eb1a..69eae0e 100644
--- a/cmake/Modules/GrMiscUtils.cmake
+++ b/cmake/Modules/GrMiscUtils.cmake
@@ -94,7 +94,11 @@ macro(GR_ADD_CXX_COMPILER_FLAG_IF_AVAILABLE flag have)
     include(CheckCXXCompilerFlag)
     CHECK_CXX_COMPILER_FLAG(${flag} ${have})
     if(${have})
-        add_definitions(${flag})
+      STRING(FIND "${CMAKE_CXX_FLAGS}" "${flag}" flag_dup)
+      if(${flag_dup} EQUAL -1)
+        set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${flag}")
+        set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${flag}")
+      endif(${flag_dup} EQUAL -1)
     endif(${have})
 endmacro(GR_ADD_CXX_COMPILER_FLAG_IF_AVAILABLE)
 
diff --git a/volk/lib/CMakeLists.txt b/volk/lib/CMakeLists.txt
index 90a8262..4713a29 100644
--- a/volk/lib/CMakeLists.txt
+++ b/volk/lib/CMakeLists.txt
@@ -391,13 +391,13 @@ if( NOT DEFINED ENABLE_ASM OR ENABLE_ASM )
     # if we find one that matches our current system architecture
     # set up the assembler flags and include the source files
     foreach(ARCH ${ASM_ARCHS_AVAILABLE})
-        string(REGEX MATCH "^${ARCH}" ASM_ARCH ${CMAKE_SYSTEM_PROCESSOR})
+        string(REGEX MATCH "^${ARCH}" ASM_ARCH "${CMAKE_SYSTEM_PROCESSOR}")
         if( ASM_ARCH STREQUAL "armv7" )
             set(ASM-ATT $ENV{ASM})
-            message("---- Adding ASM files") # we always use ATT syntax
-            message("-- Detected armv7 architecture; enabling ASM")
+            message(STATUS "---- Adding ASM files") # we always use ATT syntax
+            message(STATUS "-- Detected armv7 architecture; enabling ASM")
             # setup architecture specific assembler flags
-            set(ARCH_ASM_FLAGS "-mfpu=neon -g") 
+            set(ARCH_ASM_FLAGS "-mfpu=neon -g")
             # then add the files
             include_directories(${CMAKE_SOURCE_DIR}/kernels/volk/asm/neon)
             file(GLOB asm_files ${CMAKE_SOURCE_DIR}/kernels/volk/asm/neon/*.s)
@@ -408,7 +408,7 @@ if( NOT DEFINED ENABLE_ASM OR ENABLE_ASM )
         endif()
         set(CMAKE_ASM-ATT_FLAGS_INIT ${ARCH_ASM_FLAGS})
         enable_language(ASM-ATT) # this must be after flags_init
-        message("asm flags are ${CMAKE_ASM-ATT_FLAGS}")
+        message(STATUS "asm flags are ${CMAKE_ASM-ATT_FLAGS}")
     endforeach(ARCH)
 else()
     message("---- NOT Adding ASM files")



reply via email to

[Prev in Thread] Current Thread [Next in Thread]