1570af302Sopenharmony_cicmake_minimum_required(VERSION 3.21) 2570af302Sopenharmony_ciproject(musl_benchmark) 3570af302Sopenharmony_ci 4570af302Sopenharmony_ciset(TARGET_NAME musl_benchmark) 5570af302Sopenharmony_ciset(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -O2 -std=c++17") 6570af302Sopenharmony_ciset(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} --verbose") 7570af302Sopenharmony_ci 8570af302Sopenharmony_ciset(benchmark_DIR ../../third_party_benchmark/build) 9570af302Sopenharmony_cifind_package(benchmark REQUIRED) 10570af302Sopenharmony_ci 11570af302Sopenharmony_ci#add_subdirectory(Benchmark/musl) 12570af302Sopenharmony_ci#include(Benchmark/musl) 13570af302Sopenharmony_ci 14570af302Sopenharmony_ciif (APPLE) 15570af302Sopenharmony_cimessage(STATUS "In apple system build...") 16570af302Sopenharmony_cielse() 17570af302Sopenharmony_cimessage(FATAL_ERROR "Only for apple system build...") 18570af302Sopenharmony_ciendif() 19570af302Sopenharmony_ciset(EXCLUDE_FILES 20570af302Sopenharmony_ci libc_eventfd.cpp 21570af302Sopenharmony_ci libc_inotify.cpp 22570af302Sopenharmony_ci libc_ioctl.cpp 23570af302Sopenharmony_ci libc_pthread.cpp 24570af302Sopenharmony_ci libc_random.cpp 25570af302Sopenharmony_ci libc_sched.cpp 26570af302Sopenharmony_ci libc_signal.cpp 27570af302Sopenharmony_ci libc_syscall.cpp 28570af302Sopenharmony_ci libc_sysinfo.cpp 29570af302Sopenharmony_ci libc_time.cpp 30570af302Sopenharmony_ci libc_unistd.cpp 31570af302Sopenharmony_ci libc_dlopen.cpp 32570af302Sopenharmony_ci socket_test.cpp 33570af302Sopenharmony_ci libc_epoll.cpp) 34570af302Sopenharmony_ci 35570af302Sopenharmony_cifile(GLOB SOURCE_FILES musl/*.cpp) 36570af302Sopenharmony_ciforeach(IT IN LISTS EXCLUDE_FILES) 37570af302Sopenharmony_ci list(FILTER SOURCE_FILES EXCLUDE REGEX "${IT}") 38570af302Sopenharmony_ciendforeach() 39570af302Sopenharmony_cimessage(WARNING "glob source files: ${SOURCE_FILES}") 40570af302Sopenharmony_ci 41570af302Sopenharmony_ciadd_executable(${TARGET_NAME} ${SOURCE_FILES}) 42570af302Sopenharmony_citarget_include_directories(${TARGET_NAME} 43570af302Sopenharmony_ci AFTER 44570af302Sopenharmony_ci PRIVATE ./musl 45570af302Sopenharmony_ci PRIVATE ../../third_party_cjson) 46570af302Sopenharmony_ci 47570af302Sopenharmony_citarget_link_libraries(${TARGET_NAME} 48570af302Sopenharmony_ci PRIVATE 49570af302Sopenharmony_ci benchmark::benchmark 50570af302Sopenharmony_ci ${CMAKE_CURRENT_SOURCE_DIR}/../../third_party_cJSON/build/libcjson.dylib) 51570af302Sopenharmony_ci 52570af302Sopenharmony_ciadd_executable(musl_dlopen musl/libc_dlopen.cpp) 53570af302Sopenharmony_ci 54570af302Sopenharmony_citarget_link_libraries(musl_dlopen 55570af302Sopenharmony_ci PRIVATE 56570af302Sopenharmony_ci benchmark::benchmark) 57