Skip to content

Commit 07fc904

Browse files
committed
Do not build tests and examples by default
Signed-off-by: Darshan Sen <raisinten@gmail.com>
1 parent 56e5db2 commit 07fc904

File tree

2 files changed

+11
-4
lines changed

2 files changed

+11
-4
lines changed

Diff for: CMakeLists.txt

+10-3
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,9 @@ list(APPEND CMAKE_MODULE_PATH "${PROJECT_SOURCE_DIR}/cmake")
55
# C++ standard
66
set(CMAKE_CXX_STANDARD 20)
77

8+
option(BENONI_TESTS "Build the Benoni tests" OFF)
9+
option(BENONI_EXAMPLES "Build the Benoni examples" OFF)
10+
811
if(APPLE)
912
add_subdirectory(src/apple)
1013
elseif(WIN32)
@@ -14,7 +17,11 @@ elseif(UNIX)
1417
add_subdirectory(src/linux)
1518
endif()
1619

17-
add_subdirectory(examples)
20+
if(BENONI_EXAMPLES)
21+
add_subdirectory(examples)
22+
endif()
1823

19-
enable_testing()
20-
add_subdirectory(test)
24+
if(BENONI_TESTS)
25+
enable_testing()
26+
add_subdirectory(test)
27+
endif()

Diff for: Makefile

+1-1
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ EXAMPLE = build/examples/http_example
1111
!endif
1212

1313
configure: .always
14-
$(CMAKE) -B build
14+
$(CMAKE) -B build -DBENONI_TESTS:BOOL=ON -DBENONI_EXAMPLES:BOOL=ON
1515

1616
build: .always
1717
$(CLANG_FORMAT) --style=file -i include/benoni/http.h src/apple/http.mm src/win32/http.cc src/linux/http.cc examples/http_example.cc test/postman-echo-get.cc

0 commit comments

Comments
 (0)