|
| 1 | +# ============================================================================= |
| 2 | +# |
| 3 | +# ztd.idk |
| 4 | +# Copyright © JeanHeyd "ThePhD" Meneide and Shepherd's Oasis, LLC |
| 5 | +# Contact: opensource@soasis.org |
| 6 | +# |
| 7 | +# Commercial License Usage |
| 8 | +# Licensees holding valid commercial ztd.idk licenses may use this file in |
| 9 | +# accordance with the commercial license agreement provided with the |
| 10 | +# Software or, alternatively, in accordance with the terms contained in |
| 11 | +# a written agreement between you and Shepherd's Oasis, LLC. |
| 12 | +# For licensing terms and conditions see your agreement. For |
| 13 | +# further information contact opensource@soasis.org. |
| 14 | +# |
| 15 | +# Apache License Version 2 Usage |
| 16 | +# Alternatively, this file may be used under the terms of Apache License |
| 17 | +# Version 2.0 (the "License") for non-commercial use; you may not use this |
| 18 | +# file except in compliance with the License. You may obtain a copy of the |
| 19 | +# License at |
| 20 | +# |
| 21 | +# https://www.apache.org/licenses/LICENSE-2.0 |
| 22 | +# |
| 23 | +# Unless required by applicable law or agreed to in writing, software |
| 24 | +# distributed under the License is distributed on an "AS IS" BASIS, |
| 25 | +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
| 26 | +# See the License for the specific language governing permissions and |
| 27 | +# limitations under the License. |
| 28 | +# |
| 29 | +# ============================================================================> |
| 30 | + |
| 31 | +# # Dependencies |
| 32 | +# k_value library |
| 33 | +add_subdirectory(k_value) |
| 34 | +# nontype_functional |
| 35 | +FetchContent_Declare( |
| 36 | + nontype_functional |
| 37 | + GIT_REPOSITORY https://github.com/zhihaoy/nontype_functional.git |
| 38 | + GIT_TAG main |
| 39 | + EXCLUDE_FROM_ALL |
| 40 | +) |
| 41 | +FetchContent_MakeAvailable(nontype_functional) |
| 42 | + |
| 43 | +# # Benchmark Executable |
| 44 | +file(GLOB_RECURSE ztd.idk.benchmarks.closures.sources CONFIGURE_DEPENDS source/**) |
| 45 | + |
| 46 | +# # Needed flags |
| 47 | +check_compiler_flag(use-blocks GCC -fblocks Clang -fblocks) |
| 48 | +check_compiler_diagnostic(c99-extensions) |
| 49 | + |
| 50 | +add_executable(ztd.idk.benchmarks.closures ${ztd.idk.benchmarks.closures.sources}) |
| 51 | +target_include_directories(ztd.idk.benchmarks.closures PRIVATE |
| 52 | + include |
| 53 | + source/include |
| 54 | +) |
| 55 | +target_link_libraries(ztd.idk.benchmarks.closures PRIVATE |
| 56 | + ztd::idk |
| 57 | + ztd::idk::benchmarks::closures::k_value |
| 58 | + std23::nontype_functional |
| 59 | + benchmark |
| 60 | + ${CMAKE_DL_LIBS} |
| 61 | +) |
| 62 | +target_compile_options(ztd.idk.benchmarks.closures |
| 63 | + PRIVATE |
| 64 | + ${--utf8-literal-encoding} |
| 65 | + ${--utf8-source-encoding} |
| 66 | + ${--use-blocks} |
| 67 | + ${--allow-microsoft-enum-value} |
| 68 | + ${--allow-c99-extensions} |
| 69 | +) |
| 70 | +set_target_properties(ztd.idk.benchmarks.closures |
| 71 | + PROPERTIES |
| 72 | + CXX_EXTENSIONS TRUE |
| 73 | +) |
| 74 | + |
| 75 | +ztd_tools_add_benchmark_grapher( |
| 76 | + NAME |
| 77 | + closures |
| 78 | + CONFIG |
| 79 | + "${CMAKE_CURRENT_SOURCE_DIR}/graph_config.json" |
| 80 | + TARGETS |
| 81 | + ztd.idk.benchmarks.closures |
| 82 | + REPETITIONS |
| 83 | + ${ZTD_IDK_BENCHMARKS_REPETITIONS} |
| 84 | +) |
0 commit comments