Skip to content

Commit

Permalink
Add options to disable tests and examples, fixes #54
Browse files Browse the repository at this point in the history
  • Loading branch information
d-frey committed Apr 3, 2017
1 parent 5adda74 commit b82fa74
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 5 deletions.
2 changes: 1 addition & 1 deletion .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -156,7 +156,7 @@ matrix:
- emulator -avd test -no-audio -no-window &
- android-wait-for-emulator
script:
- cmake -DANDROID_NDK="$ANDROID_NDK_HOME" -DANDROID_ABI=armeabi-v7a
- cmake -DANDROID_NDK="$ANDROID_NDK_HOME" -DANDROID_ABI=armeabi-v7a -DBUILD_EXAMPLES=OFF
- make -j2
- make test

Expand Down
13 changes: 10 additions & 3 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,5 +1,10 @@
cmake_minimum_required (VERSION 3.2.0 FATAL_ERROR)

# options
option (BUILD_TESTS "Build test programs" ON)
option (BUILD_EXAMPLES "Build example programs" ON)

# Android stuff
if (ANDROID_NDK)
# TODO: why do we need 3.6.0?
cmake_minimum_required (VERSION 3.6.0 FATAL_ERROR)
Expand Down Expand Up @@ -31,11 +36,13 @@ target_include_directories (PEGTL INTERFACE
)

# testing
enable_testing ()
add_subdirectory (src/test/pegtl)
if (BUILD_TESTS)
enable_testing ()
add_subdirectory (src/test/pegtl)
endif ()

# examples
if (NOT MSVC AND NOT ANDROID_NDK)
if (BUILD_EXAMPLES)
add_subdirectory (src/example/pegtl)
endif ()

Expand Down
2 changes: 1 addition & 1 deletion appveyor.yml
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ build_script:
- md build
- cd build
- IF "%APPVEYOR_BUILD_WORKER_IMAGE%" == "Visual Studio 2015" (SET GEN="Visual Studio 14 2015") ELSE (SET GEN="Visual Studio 15 2017")
- cmake -Wno-dev --config "%CONFIGURATION%" .. -G%GEN%
- cmake -Wno-dev -DBUILD_EXAMPLES=OFF --config "%CONFIGURATION%" .. -G%GEN%
- cmake --build . --config "%CONFIGURATION%"

test_script:
Expand Down

0 comments on commit b82fa74

Please sign in to comment.