aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKarl Schultz <karl@lunarg.com>2017-12-23 09:16:40 -0700
committerKarl Schultz <karl@lunarg.com>2017-12-27 10:09:16 -0700
commitb13490f43afcd1784bf3d48430e63dd748d425ed (patch)
tree9c735ce445186373e033ac04219db7fa006d1aec
parentd11d8aec74764ad0995d8d963edfa47c1e90fc28 (diff)
downloadusermoji-b13490f43afcd1784bf3d48430e63dd748d425ed.tar.xz
build: Address clang compilation warnings
-rw-r--r--layers/CMakeLists.txt8
-rw-r--r--loader/CMakeLists.txt6
2 files changed, 14 insertions, 0 deletions
diff --git a/layers/CMakeLists.txt b/layers/CMakeLists.txt
index 80fa6f23..bf800e89 100644
--- a/layers/CMakeLists.txt
+++ b/layers/CMakeLists.txt
@@ -188,6 +188,14 @@ else()
set (CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Wpointer-arith -Wno-unused-function -Wno-sign-compare")
endif()
+# Clang (and not gcc) warns about unused const variables.
+# Generated files may purposely contain unused consts, so
+# silence this warning in Clang.
+if (CMAKE_C_COMPILER_ID MATCHES "Clang")
+ set_source_files_properties(parameter_validation.cpp PROPERTIES
+ COMPILE_FLAGS "-Wno-unused-const-variable")
+endif()
+
run_vk_xml_generate(threading_generator.py thread_check.h)
run_vk_xml_generate(parameter_validation_generator.py parameter_validation.cpp)
run_vk_xml_generate(unique_objects_generator.py unique_objects_wrappers.h)
diff --git a/loader/CMakeLists.txt b/loader/CMakeLists.txt
index 9c8173fa..a2a70eba 100644
--- a/loader/CMakeLists.txt
+++ b/loader/CMakeLists.txt
@@ -188,6 +188,12 @@ if (WIN32)
else()
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Wpointer-arith")
+ # Clang (and not gcc) warns about redefining a typedef with the same types, so disable that warning.
+ # Note that it will still throw an error if a typedef is redefined with a different type.
+ if (CMAKE_C_COMPILER_ID MATCHES "Clang")
+ set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Wno-typedef-redefinition")
+ endif()
+
add_library(${API_LOWERCASE} SHARED ${NORMAL_LOADER_SRCS} ${OPT_LOADER_SRCS})
add_dependencies(${API_LOWERCASE} generate_helper_files loader_gen_files loader_asm_gen_files)
set_target_properties(${API_LOWERCASE} PROPERTIES SOVERSION "1" VERSION "1.0.${vk_header_version}")