From 8b5026a81701653695c2842cbdc0ca7956fc7cfb Mon Sep 17 00:00:00 2001 From: Stephen Birarda Date: Wed, 15 Jul 2015 11:17:26 -0700 Subject: [PATCH] cleanup some warnings --- interface/CMakeLists.txt | 19 +++++++++++++------ interface/src/ui/FlowLayout.cpp | 4 ++-- libraries/entities-renderer/CMakeLists.txt | 9 ++++++++- libraries/entities/CMakeLists.txt | 9 ++++++++- libraries/physics/CMakeLists.txt | 9 ++++++++- libraries/render-utils/src/TextRenderer.cpp | 4 ++-- tests/entities/src/main.cpp | 4 ++-- tests/physics/CMakeLists.txt | 10 ++++++++-- 8 files changed, 51 insertions(+), 17 deletions(-) diff --git a/interface/CMakeLists.txt b/interface/CMakeLists.txt index 017a9d3c5f..e9c1174016 100644 --- a/interface/CMakeLists.txt +++ b/interface/CMakeLists.txt @@ -105,10 +105,10 @@ if (APPLE) # set where in the bundle to put the resources file SET_SOURCE_FILES_PROPERTIES(${CMAKE_CURRENT_SOURCE_DIR}/icon/${ICON_FILENAME} PROPERTIES MACOSX_PACKAGE_LOCATION Resources) - set(DISCOVERED_RESOURCES "") + set(DISCOVERED_RESOURCES "") # use the add_resources_to_os_x_bundle macro to recurse into resources - add_resources_to_os_x_bundle("${CMAKE_CURRENT_SOURCE_DIR}/resources") + add_resources_to_os_x_bundle("${CMAKE_CURRENT_SOURCE_DIR}/resources") # append the discovered resources to our list of interface sources list(APPEND INTERFACE_SRCS ${DISCOVERED_RESOURCES}) @@ -136,12 +136,19 @@ target_include_directories(${TARGET_NAME} PRIVATE ${LIBOVR_INCLUDE_DIRS}) target_link_libraries(${TARGET_NAME} ${LIBOVR_LIBRARIES}) find_package(Bullet REQUIRED) -target_include_directories(${TARGET_NAME} SYSTEM PRIVATE ${BULLET_INCLUDE_DIRS}) + +# perform the system include hack for OS X to ignore warnings +if (APPLE) + SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -isystem ${BULLET_INCLUDE_DIRS}") +else() + target_include_directories(${TARGET_NAME} SYSTEM PRIVATE ${BULLET_INCLUDE_DIRS}) +endif() + target_link_libraries(${TARGET_NAME} ${BULLET_LIBRARIES}) # link required hifi libraries -link_hifi_libraries(shared octree environment gpu model render fbx networking entities avatars - audio audio-client animation script-engine physics +link_hifi_libraries(shared octree environment gpu model render fbx networking entities avatars + audio audio-client animation script-engine physics render-utils entities-renderer ui auto-updater) add_dependency_external_projects(sdl2) @@ -185,7 +192,7 @@ foreach(EXTERNAL ${OPTIONAL_EXTERNALS}) endforeach() # special OS X modifications for RtMidi library -if (RTMIDI_FOUND AND NOT DISABLE_RTMIDI AND APPLE) +if (RTMIDI_FOUND AND NOT DISABLE_RTMIDI AND APPLE) find_library(CoreMIDI CoreMIDI) add_definitions(-D__MACOSX_CORE__) target_link_libraries(${TARGET_NAME} ${CoreMIDI}) diff --git a/interface/src/ui/FlowLayout.cpp b/interface/src/ui/FlowLayout.cpp index ed68204d90..c12de05629 100644 --- a/interface/src/ui/FlowLayout.cpp +++ b/interface/src/ui/FlowLayout.cpp @@ -38,14 +38,14 @@ ** ****************************************************************************/ -#ifdef __GNUC__ +#if defined(__GNUC__) && !defined(__clang__) #pragma GCC diagnostic push #pragma GCC diagnostic ignored "-Wdouble-promotion" #endif #include -#ifdef __GNUC__ +#if defined(__GNUC__) && !defined(__clang__) #pragma GCC diagnostic pop #endif diff --git a/libraries/entities-renderer/CMakeLists.txt b/libraries/entities-renderer/CMakeLists.txt index 40ca1ccbc9..810d5f5843 100644 --- a/libraries/entities-renderer/CMakeLists.txt +++ b/libraries/entities-renderer/CMakeLists.txt @@ -9,7 +9,14 @@ target_include_directories(${TARGET_NAME} PUBLIC ${GLM_INCLUDE_DIRS}) add_dependency_external_projects(bullet) find_package(Bullet REQUIRED) -target_include_directories(${TARGET_NAME} SYSTEM PRIVATE ${BULLET_INCLUDE_DIRS}) + +# perform the system include hack for OS X to ignore warnings +if (APPLE) + SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -isystem ${BULLET_INCLUDE_DIRS}") +else() + target_include_directories(${TARGET_NAME} SYSTEM PRIVATE ${BULLET_INCLUDE_DIRS}) +endif() + target_link_libraries(${TARGET_NAME} ${BULLET_LIBRARIES}) add_dependency_external_projects(polyvox) diff --git a/libraries/entities/CMakeLists.txt b/libraries/entities/CMakeLists.txt index 926fd8b4b2..f7936ff125 100644 --- a/libraries/entities/CMakeLists.txt +++ b/libraries/entities/CMakeLists.txt @@ -10,7 +10,14 @@ target_include_directories(${TARGET_NAME} PUBLIC ${GLM_INCLUDE_DIRS}) add_dependency_external_projects(bullet) find_package(Bullet REQUIRED) -target_include_directories(${TARGET_NAME} SYSTEM PRIVATE ${BULLET_INCLUDE_DIRS}) + +# perform the system include hack for OS X to ignore warnings +if (APPLE) + SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -isystem ${BULLET_INCLUDE_DIRS}") +else() + target_include_directories(${TARGET_NAME} SYSTEM PRIVATE ${BULLET_INCLUDE_DIRS}) +endif() + target_link_libraries(${TARGET_NAME} ${BULLET_LIBRARIES}) link_hifi_libraries(avatars shared octree gpu model fbx networking animation environment) diff --git a/libraries/physics/CMakeLists.txt b/libraries/physics/CMakeLists.txt index 5e94513da4..b1f9fbb79c 100644 --- a/libraries/physics/CMakeLists.txt +++ b/libraries/physics/CMakeLists.txt @@ -10,7 +10,14 @@ target_include_directories(${TARGET_NAME} PUBLIC ${GLM_INCLUDE_DIRS}) add_dependency_external_projects(bullet) find_package(Bullet REQUIRED) -target_include_directories(${TARGET_NAME} SYSTEM PRIVATE ${BULLET_INCLUDE_DIRS}) + +# perform the system include hack for OS X to ignore warnings +if (APPLE) + SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -isystem ${BULLET_INCLUDE_DIRS}") +else() + target_include_directories(${TARGET_NAME} SYSTEM PRIVATE ${BULLET_INCLUDE_DIRS}) +endif() + target_link_libraries(${TARGET_NAME} ${BULLET_LIBRARIES}) link_hifi_libraries(shared fbx entities) diff --git a/libraries/render-utils/src/TextRenderer.cpp b/libraries/render-utils/src/TextRenderer.cpp index fcd7bf2f2a..0354a0217f 100644 --- a/libraries/render-utils/src/TextRenderer.cpp +++ b/libraries/render-utils/src/TextRenderer.cpp @@ -18,7 +18,7 @@ #include #include -#ifdef __GNUC__ +#if defined(__GNUC__) && !defined(__clang__) #pragma GCC diagnostic push #pragma GCC diagnostic ignored "-Wdouble-promotion" #endif @@ -29,7 +29,7 @@ #include #include -#ifdef __GNUC__ +#if defined(__GNUC__) && !defined(__clang__) #pragma GCC diagnostic pop #endif diff --git a/tests/entities/src/main.cpp b/tests/entities/src/main.cpp index a255ffa995..740d401107 100644 --- a/tests/entities/src/main.cpp +++ b/tests/entities/src/main.cpp @@ -109,7 +109,7 @@ void testPropertyFlags(uint32_t value) { } QByteArray encoded = original.encode(); #ifndef QT_NO_DEBUG - auto originalSize = encoded.size(); + int originalSize = encoded.size(); #endif for (size_t i = 0; i < enumSize; ++i) { encoded.append(qrand()); @@ -123,7 +123,7 @@ void testPropertyFlags(uint32_t value) { { #ifndef QT_NO_DEBUG - auto decodeSize = decodeNew.decode((const uint8_t*)encoded.data(), encoded.size()); + int decodeSize = decodeNew.decode((const uint8_t*)encoded.data(), encoded.size()); #endif Q_ASSERT(originalSize == decodeSize); Q_ASSERT(decodeNew == original); diff --git a/tests/physics/CMakeLists.txt b/tests/physics/CMakeLists.txt index 6059ca3b19..36cf21c681 100644 --- a/tests/physics/CMakeLists.txt +++ b/tests/physics/CMakeLists.txt @@ -8,11 +8,17 @@ macro (SETUP_TESTCASE_DEPENDENCIES) add_dependency_external_projects(bullet) find_package(Bullet REQUIRED) - target_include_directories(${TARGET_NAME} SYSTEM PRIVATE ${BULLET_INCLUDE_DIRS}) target_link_libraries(${TARGET_NAME} ${BULLET_LIBRARIES}) + + # perform the system include hack for OS X to ignore warnings + if (APPLE) + SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -isystem ${BULLET_INCLUDE_DIRS}") + else() + target_include_directories(${TARGET_NAME} SYSTEM PRIVATE ${BULLET_INCLUDE_DIRS}) + endif() link_hifi_libraries(shared physics) copy_dlls_beside_windows_executable() endmacro () -setup_hifi_testcase(Script) \ No newline at end of file +setup_hifi_testcase(Script)