xref: /aosp_15_r20/external/executorch/extension/parallel/test/CMakeLists.txt (revision 523fa7a60841cd1ecfb9cc4201f1ca8b03ed023a)
1# Copyright (c) Meta Platforms, Inc. and affiliates.
2# All rights reserved.
3#
4# This source code is licensed under the BSD-style license found in the
5# LICENSE file in the root directory of this source tree.
6
7# This file should be formatted with
8# ~~~
9# cmake-format -i CMakeLists.txt
10# ~~~
11# It should also be cmake-lint clean.
12#
13
14cmake_minimum_required(VERSION 3.19)
15project(extension_parallel_test)
16
17# Use C++17 for test.
18set(CMAKE_CXX_STANDARD 17)
19
20set(EXECUTORCH_ROOT ${CMAKE_CURRENT_SOURCE_DIR}/../../..)
21
22include(${EXECUTORCH_ROOT}/build/Test.cmake)
23
24set(_test_srcs thread_parallel_test.cpp ../thread_parallel.cpp)
25
26et_cxx_test(
27  extension_parallel_test
28  SOURCES
29  ${_test_srcs}
30  EXTRA_LIBS
31  pthreadpool
32  cpuinfo
33  extension_threadpool
34)
35target_include_directories(
36  extension_parallel_test
37  PRIVATE ${EXECUTORCH_ROOT}/backends/xnnpack/third-party/cpuinfo/include
38          ${EXECUTORCH_ROOT}/backends/xnnpack/third-party/pthreadpool/include
39)
40