Skip to content

Commit

Permalink
Fix to use bit_BIT_NONSTD for C++17 and later (nonstd-lite-project is…
Browse files Browse the repository at this point in the history
…sue 64)
  • Loading branch information
martinmoene committed Aug 19, 2022
1 parent 6be2290 commit 11222e6
Showing 1 changed file with 11 additions and 3 deletions.
14 changes: 11 additions & 3 deletions test/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -192,9 +192,9 @@ else()
endif()
endif()

# with C++17, honour explicit request for std::bit or nonstd::bit:
# with C++17 and later, honour explicit request for std::bit or nonstd::bit:

if( HAS_CPP17_FLAG )
if( HAS_CPP17_FLAG OR HAS_CPP20_FLAG )
set( WHICH bit_BIT_DEFAULT )

if( BIT_LITE_OPT_SELECT_STD )
Expand All @@ -203,7 +203,15 @@ if( HAS_CPP17_FLAG )
set( WHICH bit_BIT_NONSTD )
endif()

target_compile_definitions( ${PROGRAM}-cpp17.t PRIVATE bit_CONFIG_SELECT_BIT=${WHICH} )
message( STATUS "Subproject '${PROJECT_NAME}', C++17 and later using '${WHICH}'")

if( HAS_CPP17_FLAG )
target_compile_definitions( ${PROGRAM}-cpp17.t PRIVATE bit_CONFIG_SELECT_BIT=${WHICH} )
endif()

if( HAS_CPP20_FLAG )
target_compile_definitions( ${PROGRAM}-cpp20.t PRIVATE bit_CONFIG_SELECT_BIT=${WHICH} )
endif()

if( HAS_CPPLATEST_FLAG )
target_compile_definitions( ${PROGRAM}-cpplatest.t PRIVATE bit_CONFIG_SELECT_BIT=${WHICH} )
Expand Down

0 comments on commit 11222e6

Please sign in to comment.