build: gh672 Fix CMake CXX_FLAGS inheritance

Some sub-projects were overwriting CMAKE_CXX_FLAGS instead of
inheriting from the parent.  This keeps any user settings outside
or above the top CMakeLists.txt file from reaching these sub-projects.

These fixes include preserving the inheritance, adding extra flags
to turn off warnings (mostly in autogen code) because the top
level turns on Wall, and trivial code fixes to avoid the need to
add a setting to turn off a warning for those trivial fixes.

These changes should have no impact on Windows.

Change-Id: I0c3c175cb5058f26a259ee3f4fde9fdaf3e6b00d
This commit is contained in:
Karl Schultz 2016-09-02 10:17:05 -06:00
parent a7c3421bc0
commit eff15fc378
2 changed files with 3 additions and 4 deletions

View File

@ -68,9 +68,8 @@ if (WIN32)
set (CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG} -D_CRT_SECURE_NO_WARNINGS /bigobj")
set (CMAKE_C_FLAGS_DEBUG "${CMAKE_C_FLAGS_DEBUG} -D_CRT_SECURE_NO_WARNINGS /bigobj")
else()
set (CMAKE_CXX_FLAGS "-std=c++11")
set (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wpointer-arith")
set (CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Wpointer-arith")
set (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wpointer-arith -Wno-unused-function")
set (CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Wpointer-arith -Wno-unused-function")
endif()
add_custom_command(OUTPUT vk_dispatch_table_helper.h

View File

@ -1505,7 +1505,7 @@ VK_LAYER_EXPORT VKAPI_ATTR PFN_vkVoidFunction VKAPI_CALL vkGetInstanceProcAddr(V
return addr;
wrapped_inst_obj *inst;
auto vk_inst = unwrap_instance(instance, &inst);
(void)unwrap_instance(instance, &inst);
VkLayerInstanceDispatchTable* pTable = &inst->layer_disp;
// EXT_debug_report