Permalink
Browse files

FIX: Make sure h3api.h.in is also auto formatted

  • Loading branch information...
zachasme committed Jan 6, 2019
1 parent a0940f6 commit 578188528a110fba610de0528e2de685b9b932a2
Showing with 14 additions and 10 deletions.
  1. +4 −1 .gitignore
  2. +5 −6 CMakeLists.txt
  3. +5 −3 src/h3lib/include/h3api.h.in
@@ -95,4 +95,7 @@ binding-functions

# These KML files are generated by `make kml`
KML/res*cells.kml
KML/res*centers.kml
KML/res*centers.kml

# Generated files
src/h3lib/include/h3api.h
@@ -187,14 +187,12 @@ set(OTHER_SOURCE_FILES
set(ALL_SOURCE_FILES
${LIB_SOURCE_FILES} ${APP_SOURCE_FILES} ${OTHER_SOURCE_FILES})

set(GENERATED_SOURCE_FILES
src/h3lib/include/h3api.h)
configure_file(
src/h3lib/include/h3api.h.in
src/h3lib/include/h3api.h)
set(UNCONFIGURED_API_HEADER src/h3lib/include/h3api.h)
set(CONFIGURED_API_HEADER src/h3lib/include/h3api.h)
configure_file(${UNCONFIGURED_API_HEADER} ${CONFIGURED_API_HEADER})

# Build the H3 library
add_library(h3 ${LIB_SOURCE_FILES} ${GENERATED_SOURCE_FILES})
add_library(h3 ${LIB_SOURCE_FILES} ${CONFIGURED_API_HEADER})

target_compile_options(h3 PRIVATE ${H3_COMPILE_FLAGS})
target_link_libraries(h3 PRIVATE ${H3_LINK_FLAGS})
@@ -232,6 +230,7 @@ if(ENABLE_FORMAT)
-i
${ALL_SOURCE_FILES}
${EXAMPLE_SOURCE_FILES}
${UNCONFIGURED_API_HEADER}
WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}
COMMENT "Formatting sources"
)
@@ -55,9 +55,11 @@ extern "C" {
typedef uint64_t H3Index;

/* library version numbers generated from VERSION file */
#define H3_VERSION_MAJOR @H3_VERSION_MAJOR@
#define H3_VERSION_MINOR @H3_VERSION_MINOR@
#define H3_VERSION_PATCH @H3_VERSION_PATCH@
// clang-format off
#define H3_VERSION_MAJOR @H3_VERSION_MAJOR @
#define H3_VERSION_MINOR @H3_VERSION_MINOR @
#define H3_VERSION_PATCH @H3_VERSION_PATCH @
// clang-format on

/** Maximum number of cell boundary vertices; worst case is pentagon:
* 5 original verts + 5 edge crossings

0 comments on commit 5781885

Please sign in to comment.