Skip to content

Commit

Permalink
update CMakeLists.txt, README.md and docs/index.md
Browse files Browse the repository at this point in the history
  • Loading branch information
TheTechsTech committed Jul 14, 2024
1 parent 0262601 commit c7820c7
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 10 deletions.
14 changes: 8 additions & 6 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -12,10 +12,6 @@ include(GenerateExportHeader)
include(FetchContent)
include(CTest)

cmake_dependent_option(BUILD_TESTING
"Build the unit tests when BUILD_TESTING is enabled and we are the root project" OFF
"BUILD_TESTING;CMAKE_SOURCE_DIR STREQUAL PROJECT_SOURCE_DIR" OFF)

message("Generated with config types: ${CMAKE_CONFIGURATION_TYPES}")

set(CMAKE_CONFIGURATION_TYPES=Debug;Release)
Expand Down Expand Up @@ -94,8 +90,14 @@ endif()
target_include_directories(raii AFTER PUBLIC
$<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/include> $<INSTALL_INTERFACE:${CMAKE_INSTALL_INCLUDEDIR}>)
target_link_libraries(coroutine PUBLIC raii)
if(BUILD_TESTING)
add_subdirectory(examples)

if(CMAKE_CURRENT_SOURCE_DIR STREQUAL CMAKE_SOURCE_DIR)
option(BUILD_EXAMPLES "whether or not examples should be built" ON)

if(BUILD_EXAMPLES)
enable_testing()
add_subdirectory(examples)
endif()
endif()

set(_fmt TGZ)
Expand Down
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -744,7 +744,7 @@ The build system uses **cmake**, that produces _single_ **static** library store
```shell
mkdir build
cd build
cmake .. -DCMAKE_BUILD_TYPE=Debug/Release -DBUILD_TESTING=ON # use to build files in examples folder
cmake .. -DCMAKE_BUILD_TYPE=Debug/Release -DBUILD_EXAMPLES=ON # use to build files in examples folder
cmake --build .
```

Expand All @@ -753,7 +753,7 @@ cmake --build .
```shell
mkdir build
cd build
cmake .. -D BUILD_TESTING=ON # use to build files in examples folder
cmake .. -D BUILD_EXAMPLES=ON # use to build files in examples folder
cmake --build . --config Debug/Release
```

Expand Down
4 changes: 2 additions & 2 deletions docs/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -1027,7 +1027,7 @@ The build system uses **cmake**, that produces _single_ **static** library store
```shell
mkdir build
cd build
cmake .. -DCMAKE_BUILD_TYPE=Debug/Release -DBUILD_TESTING=ON # use to build files in examples folder
cmake .. -DCMAKE_BUILD_TYPE=Debug/Release -DBUILD_EXAMPLES=ON # use to build files in examples folder
cmake --build .
```

Expand All @@ -1036,7 +1036,7 @@ cmake --build .
```shell
mkdir build
cd build
cmake .. -D BUILD_TESTING=ON # use to build files in examples folder
cmake .. -D BUILD_EXAMPLES=ON # use to build files in examples folder
cmake --build . --config Debug/Release
```

Expand Down

0 comments on commit c7820c7

Please sign in to comment.