diff --git a/CMakeLists.txt b/CMakeLists.txt index 7865e8cebc9af41ccc553f06794af4d467b003b3..484c800b56a0e4e3520a367535b0b7faf82f4459 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -1,19 +1,17 @@ cmake_minimum_required(VERSION 3.14) -# This is used by ASM for ASM compatibility. Include a file that the parent -# project can pass to set specific compilation flags -if (DEFINED COMMONCOMPILERFLAGFILE) - include(${COMMONCOMPILERFLAGFILE}) -endif(DEFINED COMMONCOMPILERFLAGFILE) - set(output_lib "Base") add_library(${output_lib} STATIC) # Add option to enable extra parsing of the CTest log -option(BASE_TEST_CTEST_NAMES_ARE_OUTPUT_PATHS "Declare that CTest test names are the same as the test output paths to enable extra CTest log parsing." OFF) -if (BASE_TEST_CTEST_NAMES_ARE_OUTPUT_PATHS) - target_compile_definitions(${output_lib} PRIVATE TEST_REPORT_CTEST_NAMES_ARE_OUTPUT_PATHS) +option(BASE_TEST_CTEST_NAMES_ARE_OUTPUT_PATHS + "Declare that CTest test names are the same as the test output paths to enable extra CTest log parsing." + OFF) + +if(BASE_TEST_CTEST_NAMES_ARE_OUTPUT_PATHS) + target_compile_definitions(${output_lib} PRIVATE + TEST_REPORT_CTEST_NAMES_ARE_OUTPUT_PATHS) endif() function(base_add_subdir subdir) @@ -51,17 +49,8 @@ target_include_directories(${output_lib} PUBLIC "${CMAKE_CURRENT_SOURCE_DIR}/.." set_target_properties(${output_lib} PROPERTIES CXX_VISIBILITY_PRESET hidden) set_target_properties(${output_lib} PROPERTIES C_VISIBILITY_PRESET hidden) set_target_properties(${output_lib} PROPERTIES VISIBILITY_INLINES_HIDDEN ON) -set_target_properties(${output_lib} PROPERTIES C_STANDARD 99) set_target_properties(${output_lib} PROPERTIES POSITION_INDEPENDENT_CODE ON) -# Set C++ version to 14 if on macOS (as XCode10 does not support enough of C++17) -# and 17 otherwise. -if (APPLE) - set_target_properties(${output_lib} PROPERTIES CXX_STANDARD 14) -else (APPLE) - set_target_properties(${output_lib} PROPERTIES CXX_STANDARD 17) -endif (APPLE) - if (MSVC) add_definitions(/W4) # warnings at level 4 endif (MSVC) diff --git a/Journal/JournalFileSystem.cc b/Journal/JournalFileSystem.cc index c3eb84c72a472684286ba4cbdfe4a7019e15699f..8851178cf7a977b7b3ed3d181ce10b64629056e8 100644 --- a/Journal/JournalFileSystem.cc +++ b/Journal/JournalFileSystem.cc @@ -1,4 +1,4 @@ -// Copyright 2020 Autodesk, Inc. All rights reserved. +// Copyright 2021 Autodesk, Inc. All rights reserved. // // This computer source code and related instructions and comments are the // unpublished confidential and proprietary information of Autodesk, Inc. @@ -21,11 +21,9 @@ #include <algorithm> namespace fs = Base::filesystem; -#if defined(__APPLE__) && !defined(JOURNAL_USE_BOOST) -#error Boost is required for journaling on macOS. -#endif // defined(__APPLE__) && !defined(JOURNAL_USE_BOOST) -namespace Journal { +namespace Journal +{ bool environment_base_path(const char* const _cmpn_name, String& _base_path) { diff --git a/Paths/Filesystem.hh b/Paths/Filesystem.hh index 93ac9f80dde23682a90758efa154a26e48a0815e..8704701c5f60cc18a3b0ffca9bc5545bb3424774 100755 --- a/Paths/Filesystem.hh +++ b/Paths/Filesystem.hh @@ -5,15 +5,20 @@ #include <Base/Security/Mandatory.hh> -#ifdef __APPLE__ +// NOTE: Boost required for old versions of MacOS due to lack of std::filesystem +#if defined(__APPLE__) && __MAC_OS_X_VERSION_MIN_REQUIRED < 101500 + #include <boost/filesystem.hpp> + namespace Base { namespace filesystem = boost::filesystem; typedef boost::filesystem::path Path; typedef boost::system::error_code error_code; } // namespace Base -#else // __APPLE__ + +#else // defined(__APPLE__) && __MAC_OS_X_VERSION_MIN_REQUIRED < 101500 + // Include <filesystem> but silence resulting C4995 warnings INSECURE_INCLUDE_SECTION_BEGIN #include <filesystem> @@ -24,6 +29,7 @@ namespace Base namespace filesystem = std::filesystem; typedef std::error_code error_code; } // namespace Base -#endif // __APPLE__ + +#endif // defined(__APPLE__) && __MAC_OS_X_VERSION_MIN_REQUIRED < 101500 #endif // BASE_FILESYSTEM_HH_INCLUDE diff --git a/Utils/Option.cc b/Utils/Option.cc index 0a669f54d466b405c2e5a592d64a59e3685e9c6e..92d1a9ae0d68db700771b1dc64db8cf3fd9dc95b 100644 --- a/Utils/Option.cc +++ b/Utils/Option.cc @@ -3,6 +3,9 @@ #include "Base/Security/Mandatory.hh" #include "OptionT.hh" +#include <string> +#include <stddef.h> + #ifdef TEST_ON #include <Base/Test/TestArgs.hh> diff --git a/Utils/OptionT.hh b/Utils/OptionT.hh index f0ccdf4569d25a08dd4b87207804d2b910b540f5..540cbf30331a3d88385f63ff2321943c4c15051c 100644 --- a/Utils/OptionT.hh +++ b/Utils/OptionT.hh @@ -3,6 +3,8 @@ #ifndef BASE_OPTIONT_HH_INCLUDED #define BASE_OPTIONT_HH_INCLUDED +#include <Base/Code/Quality.hh> + namespace Base { /*! @@ -25,6 +27,8 @@ public: { #ifdef TEST_ON bind(_name); +#else + LOW_CODE_QUALITY_VARIABLE_ALLOW(_name); #endif//TEST_ON }