cmake: fix clang build and few minor fixes
Change-Id: If5b850c939f7a5383f9a7eff8ac41708c3428a90 Signed-off-by: Damjan Marion <damarion@cisco.com>
This commit is contained in:
@@ -30,6 +30,11 @@ set(CMAKE_C_FLAGS_COMMON "-DFORTIFY_SOURCE=2 -fstack-protector-all -Werror")
|
||||
set(CMAKE_C_FLAGS_DEBUG "${CMAKE_C_FLAGS_DEBUG} ${CMAKE_C_FLAGS_COMMON} -DCLIB_DEBUG")
|
||||
set(CMAKE_C_FLAGS_RELEASE "${CMAKE_C_FLAGS_RELEASE} ${CMAKE_C_FLAGS_COMMON}")
|
||||
|
||||
check_c_compiler_flag("-Wno-address-of-packed-member" compiler_flag_no_address_of_packed_member)
|
||||
if (compiler_flag_no_address_of_packed_member)
|
||||
add_definitions(-Wno-address-of-packed-member)
|
||||
endif()
|
||||
|
||||
##############################################################################
|
||||
# install config
|
||||
##############################################################################
|
||||
|
||||
+4
-4
@@ -17,12 +17,12 @@
|
||||
if(CMAKE_SYSTEM_PROCESSOR MATCHES "amd64.*|x86_64.*|AMD64.*")
|
||||
set(CMAKE_C_FLAGS "-march=corei7 -mtune=corei7-avx ${CMAKE_C_FLAGS}")
|
||||
set(VPP_LIB_DIR_NAME lib64)
|
||||
check_c_compiler_flag("-march=core-avx2" AVX2)
|
||||
if(AVX2)
|
||||
check_c_compiler_flag("-march=core-avx2" compiler_flag_march_core_avx2)
|
||||
if(compiler_flag_march_core_avx2)
|
||||
list(APPEND MARCH_VARIANTS "avx2\;-march=core-avx2 -mtune=core-avx2")
|
||||
endif()
|
||||
check_c_compiler_flag("-march=skylake-avx512" AVX512)
|
||||
if(AVX512)
|
||||
check_c_compiler_flag("-march=skylake-avx512" compiler_flag_march_skylake_avx512)
|
||||
if(compiler_flag_march_skylake_avx512)
|
||||
list(APPEND MARCH_VARIANTS "avx512\;-march=skylake-avx512 -mtune=skylake-avx512")
|
||||
endif()
|
||||
elseif(CMAKE_SYSTEM_PROCESSOR MATCHES "^(aarch64.*|AARCH64.*)")
|
||||
|
||||
@@ -50,7 +50,7 @@ foreach(f ${VPP_API_FILES})
|
||||
list(APPEND VAPICLIENT_API_CPP_HEADERS ${output})
|
||||
endforeach ()
|
||||
|
||||
add_custom_target(all-vapi-headers ALL DEPENDS
|
||||
add_custom_target(all-vapi-headers DEPENDS
|
||||
${VAPICLIENT_API_C_HEADERS}
|
||||
${VAPICLIENT_API_CPP_HEADERS}
|
||||
)
|
||||
@@ -61,6 +61,7 @@ add_vpp_library(vapiclient
|
||||
libvapiclient.map
|
||||
|
||||
LINK_LIBRARIES vppinfra vlibmemoryclient svm pthread m rt
|
||||
DEPENDS all-vapi-headers
|
||||
)
|
||||
|
||||
install(
|
||||
|
||||
Reference in New Issue
Block a user