diff --git a/.travis.yml b/.travis.yml index 339f39edc0..e188f08693 100644 --- a/.travis.yml +++ b/.travis.yml @@ -67,7 +67,7 @@ matrix: apt: sources: ['ubuntu-toolchain-r-test'] packages: ['libstdc++-5-dev'] - env: CLANG_VERSION='4.0.0' BUILD_TYPE='Release' ENABLE_MASON=ON RUN_CLANG_FORMAT=ON ENABLE_LTO=ON ENABLE_NODE_BINDINGS=ON + env: CLANG_VERSION='4.0.0' BUILD_TYPE='Release' ENABLE_MASON=ON RUN_CLANG_FORMAT=ON ENABLE_LTO=ON ENABLE_NODE_BINDINGS=ON CHECK_HEADERS=yes - os: linux compiler: "gcc-6-release" @@ -81,7 +81,7 @@ matrix: compiler: "gcc-6-release-i686" env: > TARGET_ARCH='i686' CCOMPILER='gcc-6' CXXCOMPILER='g++-6' BUILD_TYPE='Release' - CFLAGS='-m32 -msse2 -mfpmath=sse' CXXFLAGS='-m32 -msse2 -mfpmath=sse' CHECK_HEADERS=yes + CFLAGS='-m32 -msse2 -mfpmath=sse' CXXFLAGS='-m32 -msse2 -mfpmath=sse' - os: linux compiler: "gcc-4.9-release" diff --git a/CMakeLists.txt b/CMakeLists.txt index 83818409b8..fe271ab80d 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -821,18 +821,21 @@ if (ENABLE_FUZZING) 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}) +# add headers sanity check target that includes all headers independently +# make sure we have all deps for the nodejs sub project's includes (nan, node) +if (ENABLE_NODE_BINDINGS) + 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}) +endif()