commit-gnuradio
[Top][All Lists]
Advanced

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

[Commit-gnuradio] [gnuradio] 02/04: MSVC-specific changes for compatibil


From: git
Subject: [Commit-gnuradio] [gnuradio] 02/04: MSVC-specific changes for compatibility
Date: Mon, 30 May 2016 21:23:21 +0000 (UTC)

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

jcorgan pushed a commit to branch maint
in repository gnuradio.

commit ae26f969c9c260556aad4ffd006fea96f3452d01
Author: gnieboer <address@hidden>
Date:   Sun Feb 7 00:03:00 2016 +0300

    MSVC-specific changes for compatibility
    
    * Changed gr-dtv cmake so SSE2 would be detected on both
      MSVC and GCC compilers
    
    * Removed addition of /O2 flag on MSVC builds as it conflicts
      with /RTC1 flag
    
    * Added detection of MSVC 14.0 and added additional filenames to
      library detection to cover what windows builds the dependencies as.
    
    * Additional name options were placed at end so as to not conflict
      with other builds.
    
    * Removed use of not() function and replaced with standard C syntax.
      The check for zero is to handle the edge case where the random
      numbers return zero and would cause a div/zero error two lines
      afterwards.
    
    * Add dwrite library for win32 builds for qtgui
---
 CMakeLists.txt                      | 12 ++++++++----
 cmake/Modules/FindGSL.cmake         |  2 +-
 cmake/Modules/FindQwt.cmake         |  4 +++-
 gnuradio-runtime/lib/math/random.cc |  2 +-
 gr-dtv/lib/CMakeLists.txt           | 19 +++++++++++++++++--
 gr-qtgui/lib/CMakeLists.txt         |  5 +++++
 6 files changed, 35 insertions(+), 9 deletions(-)

diff --git a/CMakeLists.txt b/CMakeLists.txt
index 5203e6d..9cf7ac7 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -50,10 +50,11 @@ set(VERSION_INFO_MINOR_VERSION 9)
 set(VERSION_INFO_MAINT_VERSION 2)
 include(GrVersion) #setup version info
 
-# Append -O2 optimization flag for Debug builds
-SET(CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG} -O2")
-SET(CMAKE_C_FLAGS_DEBUG "${CMAKE_C_FLAGS_DEBUG} -O2")
-
+# Append -O2 optimization flag for Debug builds (Not on MSVC since conflicts 
with RTC1 flag)
+IF (NOT MSVC)
+    SET(CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG} -O2")
+    SET(CMAKE_C_FLAGS_DEBUG "${CMAKE_C_FLAGS_DEBUG} -O2")
+ENDIF()
 ########################################################################
 # Environment setup
 ########################################################################
@@ -120,6 +121,9 @@ IF(MSVC)
     ELSE(MSVC12) #Visual Studio 12
         SET(cmake_c_compiler_version "Microsoft Visual Studio 12.0")
         SET(cmake_cxx_compiler_version "Microsoft Visual Studio 12.0")
+    ELSE(MSVC14) #Visual Studio 14
+        SET(cmake_c_compiler_version "Microsoft Visual Studio 14.0")
+        SET(cmake_cxx_compiler_version "Microsoft Visual Studio 14.0")
     ENDIF()
 ELSE()
     execute_process(COMMAND ${CMAKE_C_COMPILER} --version
diff --git a/cmake/Modules/FindGSL.cmake b/cmake/Modules/FindGSL.cmake
index b36a1e9..7b8c6cd 100644
--- a/cmake/Modules/FindGSL.cmake
+++ b/cmake/Modules/FindGSL.cmake
@@ -44,7 +44,7 @@ if( WIN32 AND NOT CYGWIN AND NOT MSYS )
 
                # look for gsl cblas library
     find_library( GSL_CBLAS_LIBRARY
-        NAMES gslcblas
+        NAMES gslcblas cblas
       )
     if( GSL_CBLAS_LIBRARY )
       set( GSL_CBLAS_FOUND ON )
diff --git a/cmake/Modules/FindQwt.cmake b/cmake/Modules/FindQwt.cmake
index 3ce49aa..da8bbe9 100644
--- a/cmake/Modules/FindQwt.cmake
+++ b/cmake/Modules/FindQwt.cmake
@@ -9,6 +9,7 @@ find_path(QWT_INCLUDE_DIRS
   NAMES qwt_global.h
   HINTS
   ${CMAKE_INSTALL_PREFIX}/include/qwt
+  ${CMAKE_PREFIX_PATH}/include/qwt
   PATHS
   /usr/local/include/qwt-qt4
   /usr/local/include/qwt
@@ -22,10 +23,11 @@ find_path(QWT_INCLUDE_DIRS
 )
 
 find_library (QWT_LIBRARIES
-  NAMES qwt6 qwt6-qt4 qwt qwt-qt4
+  NAMES qwt6 qwt6-qt4 qwt qwt-qt4 qwt5 qwtd5
   HINTS
   ${CMAKE_INSTALL_PREFIX}/lib
   ${CMAKE_INSTALL_PREFIX}/lib64
+  ${CMAKE_PREFIX_PATH}/lib 
   PATHS
   /usr/local/lib
   /usr/lib
diff --git a/gnuradio-runtime/lib/math/random.cc 
b/gnuradio-runtime/lib/math/random.cc
index 5e16c96..35f6307 100644
--- a/gnuradio-runtime/lib/math/random.cc
+++ b/gnuradio-runtime/lib/math/random.cc
@@ -127,7 +127,7 @@ namespace gr {
               x = 2.0*ran1()-1.0;
               y = 2.0*ran1()-1.0;
               s = x*x+y*y;
-          }while(not(s<1.0));
+          }while(s >= 1.0f || s == 0.0f);
           d_gauss_stored = true;
           d_gauss_value = x*sqrt(-2.0*log(s)/s);
           return y*sqrt(-2.0*log(s)/s);
diff --git a/gr-dtv/lib/CMakeLists.txt b/gr-dtv/lib/CMakeLists.txt
index 868205c..fc78ccc 100644
--- a/gr-dtv/lib/CMakeLists.txt
+++ b/gr-dtv/lib/CMakeLists.txt
@@ -128,10 +128,25 @@ list(APPEND dtv_libs
 )
 
 include (CheckCCompilerFlag)
-CHECK_C_COMPILER_FLAG ("-msse2" SSE2_SUPPORTED)
+if (MSVC)
+       # 64-bit MSVC always supports SSE2 
+       if (CMAKE_SIZEOF_VOID_P EQUAL 8)
+               set(SSE2_SUPPORTED true)
+       else ()
+               CHECK_C_COMPILER_FLAG ("/arch:SSE2" SSE2_SUPPORTED)
+       endif(CMAKE_SIZEOF_VOID_P EQUAL 8)
+else ()
+       CHECK_C_COMPILER_FLAG ("-msse2" SSE2_SUPPORTED)
+endif(MSVC)
 
 if(SSE2_SUPPORTED)
-    set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -msse2")
+       if (NOT MSVC)
+               set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -msse2")
+       else ()
+               if (CMAKE_SIZEOF_VOID_P EQUAL 4)
+                       set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /arch:SSE2")
+               endif ()
+       endif ()
     ADD_DEFINITIONS(-DDTV_SSE2)
 endif(SSE2_SUPPORTED)
 
diff --git a/gr-qtgui/lib/CMakeLists.txt b/gr-qtgui/lib/CMakeLists.txt
index a0af95b..0ac5a59 100644
--- a/gr-qtgui/lib/CMakeLists.txt
+++ b/gr-qtgui/lib/CMakeLists.txt
@@ -158,6 +158,11 @@ list(APPEND qtgui_libs
     ${FFTW3F_LIBRARIES}
     ${LOG4CPP_LIBRARIES}
 )
+if (WIN32)
+  list(APPEND qtgui_libs
+    dwrite
+  )
+endif(WIN32)
 
 include(GrPython)
 if(ENABLE_PYTHON)



reply via email to

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