Skip to content

Commit bc6242d

Browse files
committed
.
1 parent e52218a commit bc6242d

2 files changed

Lines changed: 39 additions & 15 deletions

File tree

CMakeLists.txt

Lines changed: 26 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -12,20 +12,43 @@ find_package( Threads REQUIRED )
1212
enable_testing( )
1313
add_definitions( -DBOOST_TEST_DYN_LINK )
1414

15+
16+
set( CMAKE_CXX_STANDARD 17 CACHE STRING "The C++ standard whose features are requested.")
17+
1518
include( "${CMAKE_SOURCE_DIR}/dependent_projects/CMakeListsCompiler.txt" )
1619

17-
include_directories( "./include" )
1820
set( DEP_ROOT_DIR_BASE "${CMAKE_SOURCE_DIR}/dependent_projects/build" )
1921
if( "${CMAKE_BUILD_TYPE}" STREQUAL "Debug" )
2022
set( DEP_ROOT_DIR "${DEP_ROOT_DIR_BASE}/debug" )
23+
set( GLEAN_CACHE "${CMAKE_SOURCE_DIR}/.glean/debug" )
24+
set( GLEAN_CACHE2 "${CMAKE_SOURCE_DIR}/.glean/release" )
2125
elseif( "${CMAKE_BUILD_TYPE}" STREQUAL "Release" )
2226
set( DEP_ROOT_DIR "${DEP_ROOT_DIR_BASE}/release" )
23-
elseif( "${CMAKE_BUILD_TYPE}" STREQUAL "" )
27+
set( GLEAN_CACHE "${CMAKE_SOURCE_DIR}/.glean/release" )
28+
set( GLEAN_CACHE2 "${CMAKE_SOURCE_DIR}/.glean/debug" )
29+
else( )
2430
set( DEP_ROOT_DIR "${DEP_ROOT_DIR_BASE}/release" )
31+
set( GLEAN_CACHE "${CMAKE_SOURCE_DIR}/.glean/release" )
32+
set( GLEAN_CACHE2 "${CMAKE_SOURCE_DIR}/.glean/debug" )
2533
endif( )
2634

2735
message( "Building for: ${CMAKE_BUILD_TYPE}" )
28-
if( EXISTS "${DEP_ROOT_DIR}" )
36+
message( "Checking for glean cache: '${GLEAN_CACHE}'" )
37+
if( EXISTS "${GLEAN_CACHE}" )
38+
message( "using glean dependencies" )
39+
add_custom_target( dependency_stub )
40+
include_directories( SYSTEM "${GLEAN_CACHE}/include" )
41+
link_directories( "${GLEAN_CACHE}/lib" )
42+
elseif( EXISTS "${GLEAN_CACHE2}" )
43+
message( "looks like glean is in use but missing ${GLEAN_CACHE}" )
44+
elseif( EXISTS "${CMAKE_SOURCE_DIR}/glean.cmake" )
45+
message( "glean.cmake detected" )
46+
include( "${CMAKE_SOURCE_DIR}/glean.cmake" )
47+
add_library( dependency_stub STATIC "${CMAKE_SOURCE_DIR}/dependent_projects/stub.cpp" )
48+
add_dependencies( dependency_stub ${DEP_PROJECT_DEPS} )
49+
include_directories( SYSTEM "${CMAKE_BINARY_DIR}/install/include" )
50+
link_directories( "${CMAKE_BINARY_DIR}/install/lib" )
51+
elseif( EXISTS "${DEP_ROOT_DIR}" )
2952
message( "${DEP_ROOT_DIR}" )
3053
message( "using dependency folder" )
3154
add_custom_target( dependency_stub )

include/ti_value.h

Lines changed: 13 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -38,15 +38,15 @@ namespace daw::json_to_cpp::types {
3838
struct ti_value {
3939
ti_types_t value;
4040

41-
template<
42-
typename Derived,
43-
daw::enable_if_t<std::is_constructible_v<ti_types_t, Derived>> = nullptr>
41+
template<typename Derived,
42+
daw::enable_when_t<std::is_constructible_v<ti_types_t, Derived>> =
43+
nullptr>
4444
explicit constexpr ti_value( Derived &&other )
4545
: value( std::forward<Derived>( other ) ) {}
4646

47-
template<
48-
typename Derived,
49-
daw::enable_if_t<std::is_constructible_v<ti_types_t, Derived>> = nullptr>
47+
template<typename Derived,
48+
daw::enable_when_t<std::is_constructible_v<ti_types_t, Derived>> =
49+
nullptr>
5050
constexpr ti_value &operator=( Derived &&rhs ) {
5151
value = std::forward<Derived>( rhs );
5252
return *this;
@@ -57,12 +57,13 @@ namespace daw::json_to_cpp::types {
5757
[]( auto const &item ) { return item.name( ); } );
5858
}
5959

60-
inline std::string json_name( std::string member_name,
61-
bool use_cpp20, daw::string_view parent_name ) const noexcept {
62-
return daw::visit_nt( value,
63-
[&member_name, use_cpp20, parent_name]( auto const &item ) {
64-
return item.json_name( member_name, use_cpp20, parent_name );
65-
} );
60+
inline std::string json_name( std::string member_name, bool use_cpp20,
61+
daw::string_view parent_name ) const
62+
noexcept {
63+
return daw::visit_nt(
64+
value, [&member_name, use_cpp20, parent_name]( auto const &item ) {
65+
return item.json_name( member_name, use_cpp20, parent_name );
66+
} );
6667
}
6768

6869
inline std::string array_member_info( ) const {

0 commit comments

Comments
 (0)