commit-gnuradio
[Top][All Lists]
Advanced

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

[Commit-gnuradio] [gnuradio] 06/09: cmake: add compiler flag only if the


From: git
Subject: [Commit-gnuradio] [gnuradio] 06/09: cmake: add compiler flag only if the compiler supports it
Date: Wed, 20 Aug 2014 20:18:47 +0000 (UTC)

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

jcorgan pushed a commit to branch master
in repository gnuradio.

commit 8f02178318d90fceb476a46192fa98fda5bcb0ee
Author: Michael Dickens <address@hidden>
Date:   Wed Aug 20 12:23:24 2014 -0400

    cmake: add compiler flag only if the compiler supports it
---
 cmake/Modules/UseSWIG.cmake | 10 +++++++---
 1 file changed, 7 insertions(+), 3 deletions(-)

diff --git a/cmake/Modules/UseSWIG.cmake b/cmake/Modules/UseSWIG.cmake
index 008bfa0..837659f 100644
--- a/cmake/Modules/UseSWIG.cmake
+++ b/cmake/Modules/UseSWIG.cmake
@@ -146,9 +146,13 @@ macro(SWIG_ADD_SOURCE_TO_MODULE name outfiles infile)
   endif()
 
   # Shut up some warnings from poor SWIG code generation that we
-  # can do nothing about.
-  set_source_files_properties( ${swig_generated_file_fullname}
-        PROPERTIES COMPILE_FLAGS "-Wno-unused-but-set-variable")
+  # can do nothing about, when this flag is available
+  include(CheckCXXCompilerFlag)
+  check_cxx_compiler_flag("-Wno-unused-but-set-variable" 
HAVE_WNO_UNUSED_BUT_SET_VARIABLE)
+  if(HAVE_WNO_UNUSED_BUT_SET_VARIABLE)
+    set_source_files_properties(${swig_generated_file_fullname}
+      PROPERTIES COMPILE_FLAGS "-Wno-unused-but-set-variable")
+  endif(HAVE_WNO_UNUSED_BUT_SET_VARIABLE)
 
   #message("Full path to source file: ${swig_source_file_fullname}")
   #message("Full path to the output file: ${swig_generated_file_fullname}")



reply via email to

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