Squelch PortAudio warnings on Windows x64 cmake build
authorGraham Bloice <graham.bloice@trihedral.com>
Thu, 11 Jun 2015 18:54:23 +0000 (19:54 +0100)
committerGraham Bloice <graham.bloice@trihedral.com>
Fri, 12 Jun 2015 08:30:37 +0000 (08:30 +0000)
pa_win_wmme.c generates 4 warnings due to converting size_t down to a long
All 4 get the size_t from a strlen() call on a device path so are unlikely
to exceed a long.

Change-Id: I1d768b96abf42514149db067b24c98d0b9bdfaed
Reviewed-on: https://code.wireshark.org/review/8893
Petri-Dish: Graham Bloice <graham.bloice@trihedral.com>
Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org>
Reviewed-by: Graham Bloice <graham.bloice@trihedral.com>
ui/gtk/CMakeLists.txt

index f0f5ac7fbe50884016d04fe44e5b15810b709ff0..5b27540cd36eaa6ad4c1475a0897b4e23e1a25bc 100644 (file)
@@ -157,6 +157,7 @@ if(PORTAUDIO_FOUND)
                set_target_properties(portaudio PROPERTIES
                        INCLUDE_DIRECTORIES "${PORTAUDIO_INCLUDE_DIRS}"
                        FOLDER "UI")
+
                # Portaudio has some warnings, annoyingly the combination of CMake
                # and MSBuild means that just disabling the warnings on the specific
                # source files doesn't work, so set them to level 4 for the target
@@ -172,6 +173,17 @@ if(PORTAUDIO_FOUND)
                        PUBLIC "/w44189"
                        PUBLIC "/w44305"
                )
+
+               # Portaudio has some size_t > long warnings as a result of using strlen() on x64.
+               if (WIRESHARK_TARGET_PLATFORM STREQUAL "win64")
+                       #set_source_files_properties(${PORTAUDIO_SRC_DIR}/hostapi/wmme/pa_win_wmme.c
+                       #       PROPERTIES
+                       #       COMPILE_FLAGS "/wd4267"
+                       #)
+                       target_compile_options(portaudio
+                               PUBLIC "/w44267"
+                       )
+               endif()
        endif()
 endif()