Adding autogenerated Ceres config.h to #define Ceres compile options. - Previously we passed all compile options to Ceres via add_definitions in CMake. This was fine for private definitions (used only by Ceres) but required additional work for public definitions to ensure they were correctly propagated to clients via CMake using target_compile_definitions() (>= 2.8.11) or add_definitions(). - A drawback to these approaches is that they did not work for chained dependencies on Ceres, as in if in the users project B <- A <- Ceres, then although the required Ceres public compile definitions would be used when compiling A, they would not be propagated to B. - This patch replaces the addition of compile definitions via add_definitions() with an autogenerated config.h header which is installed with Ceres and defines all of the enabled Ceres compile options. - This removes the need for the user to propagate any compile definitions in their projects, and additionally allows post-install inspect of the options with which Ceres was compiled. Change-Id: Idbdb6abdad0eb31e7540370e301afe87a07f2260
diff --git a/internal/ceres/generated/partitioned_matrix_view_2_4_9.cc b/internal/ceres/generated/partitioned_matrix_view_2_4_9.cc index 8fea0bd..d853860 100644 --- a/internal/ceres/generated/partitioned_matrix_view_2_4_9.cc +++ b/internal/ceres/generated/partitioned_matrix_view_2_4_9.cc
@@ -40,6 +40,9 @@ // This file is generated using generate_partitioned_matrix_view_specializations.py. // Editing it manually is not recommended. +// This include must come before any #ifndef check on Ceres compile options. +#include "ceres/internal/port.h" + #ifndef CERES_RESTRICT_SCHUR_SPECIALIZATION #include "ceres/partitioned_matrix_view_impl.h"