From 3188a1eb333e5dd1e8ed5881d4ea36100dddd158 Mon Sep 17 00:00:00 2001 From: Isaac Hier Date: Tue, 26 Sep 2017 12:12:55 -0400 Subject: [PATCH] Fix gtest usage. --- .travis.yml | 4 +--- CMakeLists.txt | 6 ++++++ tests/CMakeLists.txt | 6 ++++-- 3 files changed, 11 insertions(+), 5 deletions(-) diff --git a/.travis.yml b/.travis.yml index f9bd0edc..6b92868f 100644 --- a/.travis.yml +++ b/.travis.yml @@ -9,13 +9,11 @@ os: - osx install: - - wget 'https://googletest.googlecode.com/files/gtest-1.7.0.zip' - - unzip gtest-1.7.0.zip - - ln -s gtest-1.7.0 gtest - sudo pip install BeautifulSoup - sudo pip install html5lib==0.95 script: + - cd third_party/gtest && cmake . && make - mkdir build && cmake .. && make && make test - ./autogen.sh && ./configure && make && make check - python python/gumbo/gumboc_test.py diff --git a/CMakeLists.txt b/CMakeLists.txt index 3c1e8dce..20e3bbaf 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -42,6 +42,12 @@ add_library(gumbo ${SRC}) target_include_directories(gumbo PUBLIC $) +if(WIN32) + list(APPEND HEADERS visualc/include/strings.h) + target_include_directories(gumbo PUBLIC + $) +endif() + # Installation (https://github.com/forexample/package-example) # Layout. This works for all platforms: diff --git a/tests/CMakeLists.txt b/tests/CMakeLists.txt index ba78e052..49a60a7e 100644 --- a/tests/CMakeLists.txt +++ b/tests/CMakeLists.txt @@ -1,4 +1,4 @@ -enable_testing() +set(GTEST_ROOT "${PROJECT_SOURCE_DIR}/third_party/gtest") find_package(GTest REQUIRED) add_executable(gumbo_parser_unittests @@ -11,7 +11,9 @@ add_executable(gumbo_parser_unittests tokenizer.cc utf8.cc vector.cc) + target_include_directories(gumbo_parser_unittests - PUBLIC "${PROJECT_SOURCE_DIR}/src" ${CMAKE_CURRENT_SOURCE_DIR}) + PUBLIC "${PROJECT_SOURCE_DIR}/src" + ${CMAKE_CURRENT_SOURCE_DIR}) target_link_libraries(gumbo_parser_unittests gumbo GTest::GTest GTest::Main) add_test(gumbo_parser_unittests gumbo_parser_unittests)