Skip to content

Commit

Permalink
Merge pull request #138 from krasznaa/MSVCFix-main-20241121
Browse files Browse the repository at this point in the history
MSVC Fix, main branch (2024.11.21.)
  • Loading branch information
krasznaa authored Nov 22, 2024
2 parents d83f29e + 0d1471e commit c044b83
Showing 1 changed file with 14 additions and 3 deletions.
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

0 comments on commit c044b83

Please sign in to comment.