Skip to content

Commit

Permalink
馃挌 Try to repair damage from CI
Browse files Browse the repository at this point in the history
  • Loading branch information
ThePhD committed Oct 7, 2022
1 parent c29ea68 commit fd6f59a
Show file tree
Hide file tree
Showing 4 changed files with 13 additions and 4 deletions.
5 changes: 4 additions & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -119,6 +119,7 @@ option(ZTD_TEXT_DOCUMENTATION_NO_SPHINX "Turn off Sphinx usage (useful for ReadT
option(ZTD_TEXT_EXAMPLES "Enable build of examples" OFF)
option(ZTD_TEXT_BENCHMARKS "Enable build of benchmarks" OFF)
option(ZTD_TEXT_GENERATE_SINGLE "Enable generation of a single header and its target" OFF)
option(ZTD_TEXT_BOOST.TEXT "Enable usage of Boost.Text benchmarks and examples" OFF)

# # Dependencies
# ztd.idk
Expand Down Expand Up @@ -224,7 +225,9 @@ if (ZTD_TEXT_EXAMPLES OR ZTD_TEXT_BENCHMARKS)
GIT_TAG master)
FetchContent_MakeAvailable(boost.text)
endfunction()
boost_text_dependency_jail()
if (ZTD_TEXT_BOOST.TEXT)
boost_text_dependency_jail()
endif()
endif()

if(ZTD_TEXT_TESTS)
Expand Down
6 changes: 5 additions & 1 deletion benchmarks/conversion_speed/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,10 @@ file(GLOB_RECURSE ztd.text.benchmarks.conversion_speed.sources
LIST_DIRECTORIES NO
source/**)

if (NOT ZTD_TEXT_BOOST.TEXT)
list(FILTER ztd.text.benchmarks.conversion_speed.sources EXCLUDE REGEX boost.text)
endif()

add_executable(ztd.text.benchmarks.conversion_speed ${ztd.text.benchmarks.conversion_speed.sources})
target_include_directories(ztd.text.benchmarks.conversion_speed
PRIVATE
Expand All @@ -49,7 +53,7 @@ target_link_libraries(ztd.text.benchmarks.conversion_speed
ztd::text
ctre::ctre
utf8::cpp
Boost::text
$<$<BOOL:${ZTD_TEXT_BOOST.TEXT}>:Boost::text>
benchmark::benchmark
${CMAKE_DL_LIBS}
)
Expand Down
4 changes: 3 additions & 1 deletion examples/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -30,5 +30,7 @@

add_subdirectory(basic)
add_subdirectory(documentation)
add_subdirectory(boost.text)
if (ZTD_TEXT_BOOST.TEXT)
add_subdirectory(boost.text)
endif()
add_subdirectory(shift_jis)
2 changes: 1 addition & 1 deletion include/ztd/text/impl/execution_cuchar.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -352,7 +352,7 @@ namespace ztd { namespace text {

code_point __codepoint = *__in_it;
ranges::advance(__in_it);
code_unit __intermediary_output[MB_LEN_MAX] {};
code_unit __intermediary_output[(MB_LEN_MAX * 2)] {};
::std::size_t __res = ZTD_UCHAR_ACCESSOR_I_ c32rtomb(
__intermediary_output, __codepoint, ::std::addressof(__s.__narrow_state));
if constexpr (__call_error_handler) {
Expand Down

0 comments on commit fd6f59a

Please sign in to comment.