aboutsummaryrefslogtreecommitdiffstats
path: root/src/cmake/cpu.cmake
diff options
context:
space:
mode:
authorDamjan Marion <damarion@cisco.com>2021-05-10 14:51:44 +0200
committerDamjan Marion <damarion@cisco.com>2021-05-11 12:36:11 +0200
commit0d39cbac6d688fb98d05c32acec699b25a599ead (patch)
tree310b33f4b48b6aa342b0f1d398678b1e78ace81b /src/cmake/cpu.cmake
parent033e6ef52473aa3a87b1fe6db64114258106304b (diff)
build: compiler flags handling cleanup
Type: make Change-Id: I51f30edb91e09525ba116fe3941f2e43f9718da7 Signed-off-by: Damjan Marion <damarion@cisco.com>
Diffstat (limited to 'src/cmake/cpu.cmake')
-rw-r--r--src/cmake/cpu.cmake6
1 files changed, 3 insertions, 3 deletions
diff --git a/src/cmake/cpu.cmake b/src/cmake/cpu.cmake
index 539f7c803a9..f4a57a34281 100644
--- a/src/cmake/cpu.cmake
+++ b/src/cmake/cpu.cmake
@@ -115,7 +115,7 @@ macro(add_vpp_march_variant v)
endmacro()
if(CMAKE_SYSTEM_PROCESSOR MATCHES "amd64.*|x86_64.*|AMD64.*")
- set(CMAKE_C_FLAGS "-march=corei7 -mtune=corei7-avx ${CMAKE_C_FLAGS}")
+ set(VPP_DEFAULT_MARCH_FLAGS -march=corei7 -mtune=corei7-avx)
add_vpp_march_variant(hsw
FLAGS -march=haswell -mtune=haswell
@@ -138,7 +138,7 @@ if(CMAKE_SYSTEM_PROCESSOR MATCHES "amd64.*|x86_64.*|AMD64.*")
)
endif()
elseif(CMAKE_SYSTEM_PROCESSOR MATCHES "^(aarch64.*|AARCH64.*)")
- set(CMAKE_C_FLAGS "-march=armv8-a+crc ${CMAKE_C_FLAGS}")
+ set(VPP_DEFAULT_MARCH_FLAGS -march=armv8-a+crc)
add_vpp_march_variant(qdf24xx
FLAGS -march=armv8-a+crc+crypto -mtune=qdf24xx
@@ -198,7 +198,7 @@ macro(vpp_library_set_multiarch_sources lib)
add_dependencies(${l} ${ARG_DEPENDS})
endif()
set_target_properties(${l} PROPERTIES POSITION_INDEPENDENT_CODE ON)
- target_compile_options(${l} PUBLIC "-DCLIB_MARCH_VARIANT=${VARIANT}")
+ target_compile_definitions(${l} PUBLIC CLIB_MARCH_VARIANT=${VARIANT})
separate_arguments(VARIANT_FLAGS)
target_compile_options(${l} PUBLIC ${VARIANT_FLAGS})
target_sources(${lib} PRIVATE $<TARGET_OBJECTS:${l}>)