From a88e34b21b07f70123926fcb5c505d6afdf99807 Mon Sep 17 00:00:00 2001 From: Stanislaw Halik Date: Mon, 24 Dec 2018 18:54:34 +0100 Subject: style/quality only No functional changes. - add `override' everywhere where missing - almost pass clang's `-Wweak-vtables' - avoid some float/double conversions - remove unused private members - make signedness conversions explicit - put stuff in right namespaces to aid analysis --- cmake/opentrack-boilerplate.cmake | 8 ++++++-- cmake/opentrack-policy.cmake | 2 +- 2 files changed, 7 insertions(+), 3 deletions(-) (limited to 'cmake') diff --git a/cmake/opentrack-boilerplate.cmake b/cmake/opentrack-boilerplate.cmake index c56c43ee..9d72c1af 100644 --- a/cmake/opentrack-boilerplate.cmake +++ b/cmake/opentrack-boilerplate.cmake @@ -133,8 +133,6 @@ function(otr_module n_) endif() set(n "opentrack-${n_}") - # XXX TODO update callers to use instead of long name -sh 20180527 - set(self "${n}" PARENT_SCOPE) if(NOT arg_SUBDIRS) otr_glob_sources(${n} .) @@ -175,6 +173,8 @@ function(otr_module n_) set_property(TARGET "${n}" PROPERTY PREFIX "") endif() + set(self "${n}" PARENT_SCOPE) + if(NOT arg_RELINK) set_property(TARGET ${n} PROPERTY LINK_DEPENDS_NO_SHARED TRUE) else() @@ -205,6 +205,10 @@ function(otr_module n_) otr_compat(${n}) + if(CMAKE_COMPILER_IS_CLANG AND (arg_EXECUTABLE OR (NOT arg_BIN AND NOT arg_STATIC))) + set_property(TARGET "${n}" APPEND_STRING PROPERTY COMPILE_FLAGS "-Wno-weak-vtables ") + endif() + if(NOT arg_NO-INSTALL) if(arg_BIN AND WIN32) install(TARGETS "${n}" RUNTIME DESTINATION . PERMISSIONS ${opentrack-perms-exec}) diff --git a/cmake/opentrack-policy.cmake b/cmake/opentrack-policy.cmake index e86cd284..e14bcbf7 100644 --- a/cmake/opentrack-policy.cmake +++ b/cmake/opentrack-policy.cmake @@ -1,5 +1,5 @@ include_guard(GLOBAL) -foreach(k CMP0020 CMP0022 CMP0058 CMP0028 CMP0042 CMP0063 CMP0053 CMP0011 CMP0054 CMP0012) +foreach(k CMP0020 CMP0022 CMP0058 CMP0028 CMP0042 CMP0063 CMP0053 CMP0011 CMP0054 CMP0012 CMP0069) if(POLICY ${k}) cmake_policy(SET ${k} NEW) endif() -- cgit v1.2.3