]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
cmake: disable -fvar-tracking-assignments for ceph_dencoder.cc 10275/head
authorKefu Chai <kchai@redhat.com>
Wed, 13 Jul 2016 04:58:31 +0000 (12:58 +0800)
committerKefu Chai <kchai@redhat.com>
Wed, 13 Jul 2016 04:58:33 +0000 (12:58 +0800)
there are too many variables involved in main() of ceph_dencoder.cc, but
-fvar-tracking-assignments is enabled by default, when the compiler
finds that the number of variables exceeds the limit
"max-vartrack-size", it gives up, and tries again disabling this option.

this change avoids the recompilation of ceph_dencoder.cc and also silences
the warning of
```
/home/jenkins-build/build/workspace/ceph-pull-requests/src/test/encoding/ceph_dencoder.cc:
In function ‘int main(int, const char**)’:
/home/jenkins-build/build/workspace/ceph-pull-requests/src/test/encoding/ceph_dencoder.cc:289:5:
note: variable tracking size limit exceeded with
-fvar-tracking-assignments, retrying without
 int main(int argc, const char **argv)
     ^
```

Signed-off-by: Kefu Chai <kchai@redhat.com>
src/CMakeLists.txt

index cec6efbe91974b5adfaa663d5e3a9e5e73ab64b5..429af422524fa6024ebedc97b8468f0e124dbff9 100644 (file)
@@ -684,6 +684,12 @@ add_subdirectory(ceph-disk)
 add_subdirectory(ceph-detect-init)
 
 ## dencoder
+CHECK_C_COMPILER_FLAG("-fvar-tracking-assignments" HAS_VTA)
+if(HAS_VTA)
+  set_source_files_properties(test/encoding/ceph_dencoder.cc
+    PROPERTIES COMPILE_FLAGS -fno-var-tracking-assignments)
+endif()
+
 set(dencoder_srcs
   test/encoding/ceph_dencoder.cc
   $<TARGET_OBJECTS:krbd_objs>