| 1 |
# Copyright (c) 2020-2025 Intel Corporation |
| 2 |
# |
| 3 |
# Licensed under the Apache License, Version 2.0 (the "License"); |
| 4 |
# you may not use this file except in compliance with the License. |
| 5 |
# You may obtain a copy of the License at |
| 6 |
# |
| 7 |
# http://www.apache.org/licenses/LICENSE-2.0 |
| 8 |
# |
| 9 |
# Unless required by applicable law or agreed to in writing, software |
| 10 |
# distributed under the License is distributed on an "AS IS" BASIS, |
| 11 |
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
| 12 |
# See the License for the specific language governing permissions and |
| 13 |
# limitations under the License. |
| 14 |
|
| 15 |
cmake_minimum_required(VERSION 3.5.0...3.31.3) |
| 16 |
|
| 17 |
project(square CXX) |
| 18 |
|
| 19 |
include(../../common/cmake/common.cmake) |
| 20 |
|
| 21 |
set_common_project_settings(tbb) |
| 22 |
|
| 23 |
add_executable(square gen_input.cpp square.cpp) |
| 24 |
|
| 25 |
target_link_libraries(square TBB::tbb Threads::Threads) |
| 26 |
target_compile_options(square PRIVATE ${TBB_CXX_STD_FLAG}) |
| 27 |
|
| 28 |
if (MSVC AND CMAKE_CXX_COMPILER_ID STREQUAL IntelLLVM) |
| 29 |
target_compile_options(square PRIVATE -D_CRT_SECURE_NO_WARNINGS) |
| 30 |
endif() |
| 31 |
|
| 32 |
set(EXECUTABLE "$<TARGET_FILE:square>") |
| 33 |
set(ARGS 0 input.txt output.txt) |
| 34 |
set(PERF_ARGS auto input.txt output.txt silent) |
| 35 |
|
| 36 |
add_execution_target(run_square square ${EXECUTABLE} "${ARGS}") |
| 37 |
add_execution_target(perf_run_square square ${EXECUTABLE} "${PERF_ARGS}") |