Skip to content

Commit

Permalink
[Added cmakelist flag] Added flag to allow users to specify if the gt…
Browse files Browse the repository at this point in the history
…est binaries should be built
  • Loading branch information
majordoobie committed Sep 20, 2022
1 parent d58d029 commit 2cdb8e2
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 6 deletions.
3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1,2 +1,3 @@
cmake-build*
.idea
.idea
.DS_Store
15 changes: 10 additions & 5 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -17,9 +17,14 @@ include(build_utils)
add_library(thread_pool SHARED thread_pool.c)
set_project_properties(thread_pool ${PROJECT_SOURCE_DIR})

# If debug is enabled make sure to include CTest at the root. This will allow
# the ctest config to be placed at the root of the build directory
IF (CMAKE_BUILD_TYPE STREQUAL "Debug")
include(CTest)
add_subdirectory(tests)
# Flag is used to build the gtest binaries
option(BUILD_THPOOL_GTEST "Build GTests for thread_pool_c" ON)

if (BUILD_THPOOL_GTEST)
# If debug is enabled make sure to include CTest at the root. This will allow
# the ctest config to be placed at the root of the build directory
IF (CMAKE_BUILD_TYPE STREQUAL "Debug")
include(CTest)
ENDIF()
ENDIF()

0 comments on commit 2cdb8e2

Please sign in to comment.