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

Commit 79ba38b

Browse files
author
Isaac Hier
committed
Fix Windows build and gtest usage.
1 parent 48cc5b3 commit 79ba38b

File tree

3 files changed

+11
-5
lines changed

3 files changed

+11
-5
lines changed

.travis.yml

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,13 +9,11 @@ os:
99
- osx
1010

1111
install:
12-
- wget 'https://googletest.googlecode.com/files/gtest-1.7.0.zip'
13-
- unzip gtest-1.7.0.zip
14-
- ln -s gtest-1.7.0 gtest
1512
- sudo pip install BeautifulSoup
1613
- sudo pip install html5lib==0.95
1714

1815
script:
16+
- cd third_party/gtest && cmake . && make
1917
- mkdir build && cmake .. && make && make test
2018
- ./autogen.sh && ./configure && make && make check
2119
- python python/gumbo/gumboc_test.py

CMakeLists.txt

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,12 @@ add_library(gumbo ${SRC})
4242
target_include_directories(gumbo PUBLIC
4343
$<BUILD_INTERFACE:${PROJECT_SOURCE_DIR}/src>)
4444

45+
if(WIN32)
46+
list(APPEND HEADERS visualc/include/strings.h)
47+
target_include_directories(gumbo PUBLIC
48+
$<BUILD_INTERFACE:${PROJECT_SOURCE_DIR}/visualc>)
49+
endif()
50+
4551
# Installation (https://github.com/forexample/package-example)
4652

4753
# Layout. This works for all platforms:

tests/CMakeLists.txt

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
enable_testing()
1+
set(GTEST_ROOT "${PROJECT_SOURCE_DIR}/third_party/gtest")
22
find_package(GTest REQUIRED)
33

44
add_executable(gumbo_parser_unittests
@@ -11,7 +11,9 @@ add_executable(gumbo_parser_unittests
1111
tokenizer.cc
1212
utf8.cc
1313
vector.cc)
14+
1415
target_include_directories(gumbo_parser_unittests
15-
PUBLIC "${PROJECT_SOURCE_DIR}/src" ${CMAKE_CURRENT_SOURCE_DIR})
16+
PUBLIC "${PROJECT_SOURCE_DIR}/src"
17+
${CMAKE_CURRENT_SOURCE_DIR})
1618
target_link_libraries(gumbo_parser_unittests gumbo GTest::GTest GTest::Main)
1719
add_test(gumbo_parser_unittests gumbo_parser_unittests)

0 commit comments

Comments
 (0)