Add headers consistency check
This commit is contained in:
		
							parent
							
								
									dc8e6bd8d9
								
							
						
					
					
						commit
						84b618ed1a
					
				@ -78,7 +78,7 @@ matrix:
 | 
				
			|||||||
      compiler: "gcc-6-release-i686"
 | 
					      compiler: "gcc-6-release-i686"
 | 
				
			||||||
      env: >
 | 
					      env: >
 | 
				
			||||||
        TARGET_ARCH='i686' CCOMPILER='gcc-6' CXXCOMPILER='g++-6' BUILD_TYPE='Release'
 | 
					        TARGET_ARCH='i686' CCOMPILER='gcc-6' CXXCOMPILER='g++-6' BUILD_TYPE='Release'
 | 
				
			||||||
        CFLAGS='-m32 -msse2 -mfpmath=sse' CXXFLAGS='-m32 -msse2 -mfpmath=sse'
 | 
					        CFLAGS='-m32 -msse2 -mfpmath=sse' CXXFLAGS='-m32 -msse2 -mfpmath=sse' CHECK_HEADERS=yes
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    - os: linux
 | 
					    - os: linux
 | 
				
			||||||
      compiler: "gcc-4.9-release"
 | 
					      compiler: "gcc-4.9-release"
 | 
				
			||||||
@ -170,6 +170,7 @@ install:
 | 
				
			|||||||
    if [[ "${TRAVIS_OS_NAME}" == "linux" ]]; then
 | 
					    if [[ "${TRAVIS_OS_NAME}" == "linux" ]]; then
 | 
				
			||||||
      sudo ldconfig
 | 
					      sudo ldconfig
 | 
				
			||||||
    fi
 | 
					    fi
 | 
				
			||||||
 | 
					  - if [[ ${CHECK_HEADERS} == yes ]] ; then make check-headers ; fi
 | 
				
			||||||
  - popd
 | 
					  - popd
 | 
				
			||||||
  - mkdir example/build && pushd example/build
 | 
					  - mkdir example/build && pushd example/build
 | 
				
			||||||
  - cmake .. -DCMAKE_BUILD_TYPE=${BUILD_TYPE}
 | 
					  - cmake .. -DCMAKE_BUILD_TYPE=${BUILD_TYPE}
 | 
				
			||||||
 | 
				
			|||||||
@ -751,3 +751,21 @@ if (ENABLE_FUZZING)
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
  add_subdirectory(fuzz)
 | 
					  add_subdirectory(fuzz)
 | 
				
			||||||
endif ()
 | 
					endif ()
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					## add headers sanity check target that includes all headers independently
 | 
				
			||||||
 | 
					set(check_headers_dir "${PROJECT_BINARY_DIR}/check-headers")
 | 
				
			||||||
 | 
					file(GLOB_RECURSE headers_to_check
 | 
				
			||||||
 | 
					  ${PROJECT_BINARY_DIR}/*.hpp
 | 
				
			||||||
 | 
					  ${PROJECT_SOURCE_DIR}/include/*.hpp)
 | 
				
			||||||
 | 
					foreach(header ${headers_to_check})
 | 
				
			||||||
 | 
					  get_filename_component(filename ${header} NAME_WE)
 | 
				
			||||||
 | 
					  set(filename "${check_headers_dir}/${filename}.cpp")
 | 
				
			||||||
 | 
					  if (NOT EXISTS ${filename})
 | 
				
			||||||
 | 
					    file(WRITE ${filename} "#include \"${header}\"\n")
 | 
				
			||||||
 | 
					  endif()
 | 
				
			||||||
 | 
					  list(APPEND sources ${filename})
 | 
				
			||||||
 | 
					endforeach()
 | 
				
			||||||
 | 
					add_library(check-headers STATIC EXCLUDE_FROM_ALL ${sources})
 | 
				
			||||||
 | 
					set_target_properties(check-headers PROPERTIES ARCHIVE_OUTPUT_DIRECTORY ${check_headers_dir})
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
				
			|||||||
@ -7,6 +7,7 @@
 | 
				
			|||||||
#include "extractor/guidance/turn_instruction.hpp"
 | 
					#include "extractor/guidance/turn_instruction.hpp"
 | 
				
			||||||
#include "extractor/guidance/turn_lane_types.hpp"
 | 
					#include "extractor/guidance/turn_lane_types.hpp"
 | 
				
			||||||
#include "extractor/profile_properties.hpp"
 | 
					#include "extractor/profile_properties.hpp"
 | 
				
			||||||
 | 
					#include "storage/shared_datatype.hpp"
 | 
				
			||||||
#include "util/guidance/bearing_class.hpp"
 | 
					#include "util/guidance/bearing_class.hpp"
 | 
				
			||||||
#include "util/guidance/entry_class.hpp"
 | 
					#include "util/guidance/entry_class.hpp"
 | 
				
			||||||
#include "util/guidance/turn_lanes.hpp"
 | 
					#include "util/guidance/turn_lanes.hpp"
 | 
				
			||||||
 | 
				
			|||||||
@ -3,6 +3,7 @@
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
#include <cmath>
 | 
					#include <cmath>
 | 
				
			||||||
#include <cstdint>
 | 
					#include <cstdint>
 | 
				
			||||||
 | 
					#include <cstdlib>
 | 
				
			||||||
#include <string>
 | 
					#include <string>
 | 
				
			||||||
 | 
					
 | 
				
			||||||
#include "extractor/guidance/constants.hpp"
 | 
					#include "extractor/guidance/constants.hpp"
 | 
				
			||||||
 | 
				
			|||||||
@ -8,6 +8,7 @@
 | 
				
			|||||||
#include <boost/assert.hpp>
 | 
					#include <boost/assert.hpp>
 | 
				
			||||||
 | 
					
 | 
				
			||||||
#include "extractor/guidance/road_classification.hpp"
 | 
					#include "extractor/guidance/road_classification.hpp"
 | 
				
			||||||
 | 
					#include "extractor/guidance/turn_lane_types.hpp"
 | 
				
			||||||
#include "osrm/coordinate.hpp"
 | 
					#include "osrm/coordinate.hpp"
 | 
				
			||||||
#include <utility>
 | 
					#include <utility>
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
				
			|||||||
@ -1,6 +1,8 @@
 | 
				
			|||||||
#ifndef CONTAINER_HPP
 | 
					#ifndef CONTAINER_HPP
 | 
				
			||||||
#define CONTAINER_HPP
 | 
					#define CONTAINER_HPP
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					#include <utility>
 | 
				
			||||||
 | 
					
 | 
				
			||||||
namespace osrm
 | 
					namespace osrm
 | 
				
			||||||
{
 | 
					{
 | 
				
			||||||
namespace util
 | 
					namespace util
 | 
				
			||||||
 | 
				
			|||||||
@ -1,6 +1,8 @@
 | 
				
			|||||||
#ifndef DIST_TABLE_WRAPPER_H
 | 
					#ifndef DIST_TABLE_WRAPPER_H
 | 
				
			||||||
#define DIST_TABLE_WRAPPER_H
 | 
					#define DIST_TABLE_WRAPPER_H
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					#include "util/typedefs.hpp"
 | 
				
			||||||
 | 
					
 | 
				
			||||||
#include <algorithm>
 | 
					#include <algorithm>
 | 
				
			||||||
#include <boost/assert.hpp>
 | 
					#include <boost/assert.hpp>
 | 
				
			||||||
#include <cstddef>
 | 
					#include <cstddef>
 | 
				
			||||||
 | 
				
			|||||||
@ -1,3 +1,4 @@
 | 
				
			|||||||
 | 
					#include "util/fingerprint.hpp"
 | 
				
			||||||
#include "util/exception.hpp"
 | 
					#include "util/exception.hpp"
 | 
				
			||||||
#include "util/exception_utils.hpp"
 | 
					#include "util/exception_utils.hpp"
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
				
			|||||||
@ -5,6 +5,7 @@
 | 
				
			|||||||
#include <mutex>
 | 
					#include <mutex>
 | 
				
			||||||
#include <string>
 | 
					#include <string>
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					#include "util/exception.hpp"
 | 
				
			||||||
#include "util/json_container.hpp"
 | 
					#include "util/json_container.hpp"
 | 
				
			||||||
#include "util/json_renderer.hpp"
 | 
					#include "util/json_renderer.hpp"
 | 
				
			||||||
#include "util/log.hpp"
 | 
					#include "util/log.hpp"
 | 
				
			||||||
 | 
				
			|||||||
@ -1,9 +1,12 @@
 | 
				
			|||||||
#ifndef OSRM_GEOJSON_DEBUG_POLICY_TOOLKIT_HPP
 | 
					#ifndef OSRM_GEOJSON_DEBUG_POLICY_TOOLKIT_HPP
 | 
				
			||||||
#define OSRM_GEOJSON_DEBUG_POLICY_TOOLKIT_HPP
 | 
					#define OSRM_GEOJSON_DEBUG_POLICY_TOOLKIT_HPP
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					#include "extractor/external_memory_node.hpp"
 | 
				
			||||||
 | 
					#include "util/coordinate.hpp"
 | 
				
			||||||
#include "util/json_container.hpp"
 | 
					#include "util/json_container.hpp"
 | 
				
			||||||
 | 
					
 | 
				
			||||||
#include <algorithm>
 | 
					#include <algorithm>
 | 
				
			||||||
 | 
					#include <iterator>
 | 
				
			||||||
 | 
					
 | 
				
			||||||
#include <boost/optional.hpp>
 | 
					#include <boost/optional.hpp>
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
				
			|||||||
		Loading…
	
		Reference in New Issue
	
	Block a user