Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

MSVC Fix, main branch (2024.11.21.) #138

Merged
merged 1 commit into from
Nov 22, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 14 additions & 3 deletions cmake/algebra-plugins-functions.cmake
Original file line number Diff line number Diff line change
@@ -1,13 +1,14 @@
# Algebra plugins library, part of the ACTS project (R&D line)
#
# (c) 2021-2023 CERN for the benefit of the ACTS project
# (c) 2021-2024 CERN for the benefit of the ACTS project
#
# Mozilla Public License Version 2.0

# Guard against multiple includes.
include_guard( GLOBAL )

# CMake include(s).
include( CheckCXXCompilerFlag )
include( CMakeParseArguments )

# Helper function for setting up the algebra plugins libraries.
Expand Down Expand Up @@ -121,8 +122,18 @@ function( algebra_add_benchmark name )
set( bench_exe_name "algebra_benchmark_${name}" )
add_executable( ${bench_exe_name} ${ARG_UNPARSED_ARGUMENTS} )

target_compile_options( algebra_benchmark_${name} PRIVATE
"-march=native" "-ftree-vectorize")
# Build benchmarks for the native architecture by default. Can be overridden
# from the command line.
set( ALGEBRA_BENCHMARK_ARCHITECTURE_FLAG "-march=native" CACHE STRING
"Architecture flag for the algebra benchmarks" )
mark_as_advanced( ALGEBRA_BENCHMARK_ARCHITECTURE_FLAG )
check_cxx_compiler_flag( "${ALGEBRA_BENCHMARK_ARCHITECTURE_FLAG}"
ALGEBRA_BENCHMARK_ARCHITECTURE_FLAG_SUPPORTED )
if( ALGEBRA_BENCHMARK_ARCHITECTURE_FLAG_SUPPORTED AND
( NOT "${CMAKE_CXX_FLAGS}" MATCHES "-march=" ) )
target_compile_options( algebra_benchmark_${name} PRIVATE
"${ALGEBRA_BENCHMARK_ARCHITECTURE_FLAG}" )
endif()

if( ARG_LINK_LIBRARIES )
target_link_libraries( ${bench_exe_name} PRIVATE ${ARG_LINK_LIBRARIES} )
Expand Down