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

#2122: Silence icpc deprecation warning #2129

Merged
merged 3 commits into from
May 9, 2023
Merged
Show file tree
Hide file tree
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
12 changes: 10 additions & 2 deletions cmake-modules/SetCXXCompilerFlags.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,14 @@ function(set_darma_compiler_flags vt_target)
if (APPLE)
list(APPEND TARGET_PUBLIC_CXX_FLAGS -stdlib=libc++)
endif ()
elseif (CMAKE_CXX_COMPILER_ID STREQUAL IntelLLVM AND CMAKE_CXX_COMPILER_VERSION VERSION_GREATER_EQUAL 2021.3.0)
elseif (CMAKE_CXX_COMPILER_ID STREQUAL "IntelLLVM" AND CMAKE_CXX_COMPILER_VERSION VERSION_GREATER_EQUAL 2021.3.0)
list(APPEND TARGET_PRIVATE_CXX_FLAGS -fhonor-infinites -fhonor-nans)
elseif (${CMAKE_CXX_COMPILER_ID} STREQUAL "Intel")
# Intel classic (icpc)
# Set as PUBLIC because we want to propagate it to "derived" targets
# gtest-main links with gtest, while VT's tests link with base VT
list(APPEND TARGET_PUBLIC_CXX_FLAGS -diag-disable=10441)
list(APPEND TARGET_PUBLIC_LINK_FLAGS -diag-disable=10441)
elseif (NOT ${CMAKE_CXX_COMPILER_ID} MATCHES "Intel")
message(FATAL_ERROR "Your C++ compiler may not support C++14.")
endif ()
Expand All @@ -26,9 +32,11 @@ function(set_darma_compiler_flags vt_target)
endif()
endif()

message(DEBUG "Target ${vt_target} public compile options: ${TARGET_PUBLIC_CXX_FLAGS}")
message(DEBUG "Target ${vt_target} public compile options: ${TARGET_PUBLIC_CXX_FLAGS} \n public link options: ${TARGET_PUBLIC_LINK_FLAGS}")
target_compile_options(${vt_target} PUBLIC ${TARGET_PUBLIC_CXX_FLAGS})
target_link_options(${vt_target} PUBLIC ${TARGET_PUBLIC_LINK_FLAGS})

message(DEBUG "Target ${vt_target} private compile options: ${TARGET_PRIVATE_CXX_FLAGS}")
target_compile_options(${vt_target} PRIVATE ${TARGET_PRIVATE_CXX_FLAGS})

endfunction()
7 changes: 5 additions & 2 deletions cmake/load_bundled_libraries.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -41,9 +41,12 @@ set(BROTLI_DISABLE_TESTS ON)
# we need to disable bundled mode so it will install properly
set(BROTLI_BUNDLED_MODE OFF)
set(BROTLI_BUILD_PORTABLE ON)
set(BROTLI_LIBRARY brotlicommon-static brotlienc-static brotlidec-static)
set(BROTLI_BUILD_SHARED_LIBS OFF)
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

vt is only using static libs. This shouldn't affect anyone, I think.

set(BROTLI_LIBRARY brotlicommon-static brotlidec-static brotlienc-static)
add_subdirectory(${PROJECT_LIB_DIR}/brotli)
set_darma_compiler_flags(${BROTLI_LIBRARY})
foreach(lib ${BROTLI_LIBRARY})
set_darma_compiler_flags(${lib})
endforeach()

# Optionally include mimalloc (alternative memory allocator)
if (vt_mimalloc_enabled)
Expand Down
6 changes: 3 additions & 3 deletions lib/brotli/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -162,7 +162,7 @@ endfunction()
transform_sources_list("scripts/sources.lst" "${CMAKE_CURRENT_BINARY_DIR}/sources.lst.cmake")
include("${CMAKE_CURRENT_BINARY_DIR}/sources.lst.cmake")

if(BROTLI_EMSCRIPTEN)
if(BROTLI_EMSCRIPTEN OR NOT BROTLI_BUILD_SHARED_LIBS)
set(BROTLI_SHARED_LIBS "")
else()
set(BROTLI_SHARED_LIBS brotlicommon brotlidec brotlienc)
Expand Down Expand Up @@ -206,7 +206,7 @@ foreach(lib IN LISTS BROTLI_SHARED_LIBS BROTLI_STATIC_LIBS)
# set_property(TARGET ${lib} APPEND PROPERTY INTERFACE_INCLUDE_DIRECTORIES "${BROTLI_INCLUDE_DIRS}")
endforeach()

if(NOT BROTLI_EMSCRIPTEN)
if(NOT BROTLI_EMSCRIPTEN AND BROTLI_BUILD_SHARED_LIBS)
target_link_libraries(brotlidec brotlicommon)
target_link_libraries(brotlienc brotlicommon)
endif()
Expand All @@ -230,7 +230,7 @@ add_executable(brotli ${BROTLI_CLI_C})
target_link_libraries(brotli ${BROTLI_LIBRARIES_STATIC})

# Installation
if(NOT BROTLI_EMSCRIPTEN)
if(NOT BROTLI_EMSCRIPTEN AND BROTLI_BUILD_SHARED_LIBS)
if(NOT BROTLI_BUNDLED_MODE)
install(
TARGETS brotli
Expand Down