Skip to content

Commit

Permalink
Fix issue #285 by respecting BUILD_TESTING
Browse files Browse the repository at this point in the history
  • Loading branch information
ned14 committed Jul 20, 2023
1 parent 0bedf67 commit d45173e
Show file tree
Hide file tree
Showing 8 changed files with 23 additions and 19 deletions.
6 changes: 3 additions & 3 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ option(OUTCOME_ENABLE_DEPENDENCY_SMOKE_TEST "Whether to build executables which
option(OUTCOME_ENABLE_CXX_MODULES "Whether to enable the building of an Outcome C++ module" OFF)
set(UNIT_TESTS_CXX_VERSION "latest" CACHE STRING "The version of C++ to use in the unit tests")

if(NOT PROJECT_IS_DEPENDENCY)
if(NOT outcome_IS_DEPENDENCY)
# This file should be updated with the last git SHA next commit
UpdateRevisionHppFromGit("${CMAKE_CURRENT_SOURCE_DIR}/include/outcome/detail/revision.hpp")
# Need to also possibly update the .natvis file
Expand Down Expand Up @@ -107,7 +107,7 @@ include(QuickCppLibMakeHeaderOnlyLibrary)
apply_cxx_concepts_to(INTERFACE outcome_hl REQUIRE_STD_CONCEPTS)

# Make preprocessed edition of this library target
if(NOT PROJECT_IS_DEPENDENCY OR OUTCOME_FORCE_ENABLE_PP_TARGETS)
if(NOT outcome_IS_DEPENDENCY OR OUTCOME_FORCE_ENABLE_PP_TARGETS)
if(NOT PYTHONINTERP_FOUND)
indented_message(WARNING "NOT rebuilding preprocessed edition of library due to python not being installed")
else()
Expand Down Expand Up @@ -182,7 +182,7 @@ if(OUTCOME_ENABLE_CXX_MODULES)
)
endif()

if(EXISTS "${CMAKE_CURRENT_SOURCE_DIR}/test" AND NOT PROJECT_IS_DEPENDENCY)
if(EXISTS "${CMAKE_CURRENT_SOURCE_DIR}/test" AND NOT outcome_IS_DEPENDENCY AND (NOT DEFINED BUILD_TESTING OR BUILD_TESTING))
# For all possible configurations of this library, add each test
list_filter(outcome_TESTS EXCLUDE REGEX "constexprs")
set(outcome_TESTS_DISABLE_PRECOMPILE_HEADERS
Expand Down
2 changes: 1 addition & 1 deletion cmake/QuickCppLibBootstrap.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ foreach(item ${CMAKE_MODULE_PATH})
set(quickcpplib_done ON)
endif()
endforeach()
if(NOT quickcpplib_done AND quickcpplib_DIR)
if(NOT quickcpplib_done)
find_package(quickcpplib QUIET CONFIG)
if(quickcpplib_FOUND)
if(DEFINED quickcpplib_CMAKELIB_DIR AND DEFINED quickcpplib_SCRIPTS_DIR)
Expand Down
2 changes: 1 addition & 1 deletion doc/src/content/changelog/_index.md
Original file line number Diff line number Diff line change
Expand Up @@ -332,7 +332,7 @@ use cases.
Precompiled headers are automatically enabled on new enough cmake's for standalone Outcome
: If on cmake 3.16 or later, its new precompiled headers build support is used
to tell consumers of the `outcome::hl` cmake target to precompile Outcome, **if
and only if** `PROJECT_IS_DEPENDENCY` is false. `PROJECT_IS_DEPENDENCY` is set
and only if** `outcome_IS_DEPENDENCY` is false. `outcome_IS_DEPENDENCY` is set
by Outcome's CMakeLists.txt if it detects that it was included using
`add_subdirectory()`, so for the vast majority of Outcome end users, the use
of precompiled headers will NOT be enabled.
Expand Down
6 changes: 3 additions & 3 deletions include/outcome/detail/revision.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,6 @@ Distributed under the Boost Software License, Version 1.0.
*/

// Note the second line of this file must ALWAYS be the git SHA, third line ALWAYS the git SHA update time
#define OUTCOME_PREVIOUS_COMMIT_REF 06da8aa6452ede5600af3c4ed4781ebd631149f9
#define OUTCOME_PREVIOUS_COMMIT_DATE "2023-07-15 10:37:16 +00:00"
#define OUTCOME_PREVIOUS_COMMIT_UNIQUE 06da8aa6
#define OUTCOME_PREVIOUS_COMMIT_REF 0bedf671c04467d66219454bd9a61d0bfbb99242
#define OUTCOME_PREVIOUS_COMMIT_DATE "2023-07-20 08:20:32 +00:00"
#define OUTCOME_PREVIOUS_COMMIT_UNIQUE 0bedf671
6 changes: 3 additions & 3 deletions single-header/outcome-basic.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -996,9 +996,9 @@ Distributed under the Boost Software License, Version 1.0.
http://www.boost.org/LICENSE_1_0.txt)
*/
// Note the second line of this file must ALWAYS be the git SHA, third line ALWAYS the git SHA update time
#define OUTCOME_PREVIOUS_COMMIT_REF 06da8aa6452ede5600af3c4ed4781ebd631149f9
#define OUTCOME_PREVIOUS_COMMIT_DATE "2023-07-15 10:37:16 +00:00"
#define OUTCOME_PREVIOUS_COMMIT_UNIQUE 06da8aa6
#define OUTCOME_PREVIOUS_COMMIT_REF 0bedf671c04467d66219454bd9a61d0bfbb99242
#define OUTCOME_PREVIOUS_COMMIT_DATE "2023-07-20 08:20:32 +00:00"
#define OUTCOME_PREVIOUS_COMMIT_UNIQUE 0bedf671
#define OUTCOME_V2 (QUICKCPPLIB_BIND_NAMESPACE_VERSION(outcome_v2))
#ifdef _DEBUG
#define OUTCOME_V2_CXX_MODULE_NAME QUICKCPPLIB_BIND_NAMESPACE((QUICKCPPLIB_BIND_NAMESPACE_VERSION(outcome_v2d)))
Expand Down
12 changes: 8 additions & 4 deletions single-header/outcome-experimental.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -1021,9 +1021,9 @@ Distributed under the Boost Software License, Version 1.0.
http://www.boost.org/LICENSE_1_0.txt)
*/
// Note the second line of this file must ALWAYS be the git SHA, third line ALWAYS the git SHA update time
#define OUTCOME_PREVIOUS_COMMIT_REF 06da8aa6452ede5600af3c4ed4781ebd631149f9
#define OUTCOME_PREVIOUS_COMMIT_DATE "2023-07-15 10:37:16 +00:00"
#define OUTCOME_PREVIOUS_COMMIT_UNIQUE 06da8aa6
#define OUTCOME_PREVIOUS_COMMIT_REF 0bedf671c04467d66219454bd9a61d0bfbb99242
#define OUTCOME_PREVIOUS_COMMIT_DATE "2023-07-20 08:20:32 +00:00"
#define OUTCOME_PREVIOUS_COMMIT_UNIQUE 0bedf671
#define OUTCOME_V2 (QUICKCPPLIB_BIND_NAMESPACE_VERSION(outcome_v2))
#ifdef _DEBUG
#define OUTCOME_V2_CXX_MODULE_NAME QUICKCPPLIB_BIND_NAMESPACE((QUICKCPPLIB_BIND_NAMESPACE_VERSION(outcome_v2d)))
Expand Down Expand Up @@ -9070,8 +9070,12 @@ namespace detail
{
namespace avoid_string_include
{
#if defined(__GLIBC__) && !defined(__UCLIBC__)
// This returns int for non-glibc strerror_r, but glibc's is particularly weird so we retain it
extern "C" char *strerror_r(int errnum, char *buf, size_t buflen);
#else
extern "C" int strerror_r(int errnum, char *buf, size_t buflen);
#endif
} // namespace avoid_string_include
} // namespace detail
#endif
Expand Down Expand Up @@ -9101,7 +9105,7 @@ class _posix_code_domain : public status_code_domain
char buffer[1024] = "";
#ifdef _WIN32
strerror_s(buffer, sizeof(buffer), c);
#elif defined(__gnu_linux__) && !defined(__ANDROID__) // handle glibc's weird strerror_r()
#elif defined(__GLIBC__) && !defined(__UCLIBC__) // handle glibc's weird strerror_r()
char *s = detail::avoid_string_include::strerror_r(c, buffer, sizeof(buffer)); // NOLINT
if(s != nullptr)
{
Expand Down
6 changes: 3 additions & 3 deletions single-header/outcome.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -1020,9 +1020,9 @@ Distributed under the Boost Software License, Version 1.0.
http://www.boost.org/LICENSE_1_0.txt)
*/
// Note the second line of this file must ALWAYS be the git SHA, third line ALWAYS the git SHA update time
#define OUTCOME_PREVIOUS_COMMIT_REF 06da8aa6452ede5600af3c4ed4781ebd631149f9
#define OUTCOME_PREVIOUS_COMMIT_DATE "2023-07-15 10:37:16 +00:00"
#define OUTCOME_PREVIOUS_COMMIT_UNIQUE 06da8aa6
#define OUTCOME_PREVIOUS_COMMIT_REF 0bedf671c04467d66219454bd9a61d0bfbb99242
#define OUTCOME_PREVIOUS_COMMIT_DATE "2023-07-20 08:20:32 +00:00"
#define OUTCOME_PREVIOUS_COMMIT_UNIQUE 0bedf671
#define OUTCOME_V2 (QUICKCPPLIB_BIND_NAMESPACE_VERSION(outcome_v2))
#ifdef _DEBUG
#define OUTCOME_V2_CXX_MODULE_NAME QUICKCPPLIB_BIND_NAMESPACE((QUICKCPPLIB_BIND_NAMESPACE_VERSION(outcome_v2d)))
Expand Down

0 comments on commit d45173e

Please sign in to comment.