Skip to content
This repository has been archived by the owner on Feb 15, 2023. It is now read-only.

Commit

Permalink
Fix Windows build and gtest usage.
Browse files Browse the repository at this point in the history
  • Loading branch information
Isaac Hier committed Sep 26, 2017
1 parent 48cc5b3 commit 79ba38b
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 5 deletions.
4 changes: 1 addition & 3 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
6 changes: 6 additions & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,12 @@ add_library(gumbo ${SRC})
target_include_directories(gumbo PUBLIC
$<BUILD_INTERFACE:${PROJECT_SOURCE_DIR}/src>)

if(WIN32)
list(APPEND HEADERS visualc/include/strings.h)
target_include_directories(gumbo PUBLIC
$<BUILD_INTERFACE:${PROJECT_SOURCE_DIR}/visualc>)
endif()

# Installation (https://github.com/forexample/package-example)

# Layout. This works for all platforms:
Expand Down
6 changes: 4 additions & 2 deletions tests/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
enable_testing()
set(GTEST_ROOT "${PROJECT_SOURCE_DIR}/third_party/gtest")
find_package(GTest REQUIRED)

add_executable(gumbo_parser_unittests
Expand All @@ -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)

0 comments on commit 79ba38b

Please sign in to comment.