Skip to content

Commit 9b03c13

Browse files
authored
Avoid compiler warnings (nv-morpheus#2054)
* Set CMake policy #`CMP0144` to `NEW` in C++ examples, avoids a deprecation warning * Set `-lto=auto` to avoid a warning about falling back to serialized compilation. Related to nv-morpheus/MRC#518 . Closes nv-morpheus#1988 ## By Submitting this PR I confirm: - I am familiar with the [Contributing Guidelines](https://github.com/nv-morpheus/Morpheus/blob/main/docs/source/developer_guide/contributing.md). - When the PR is ready for review, new or existing tests cover these changes. - When the PR is ready for review, the documentation is up to date with these changes. Authors: - David Gardner (https://github.com/dagardner-nv) Approvers: - Michael Demoret (https://github.com/mdemoret-nv) URL: nv-morpheus#2054
1 parent d895db8 commit 9b03c13

File tree

4 files changed

+14
-0
lines changed

4 files changed

+14
-0
lines changed

examples/developer_guide/3_simple_cpp_stage/CMakeLists.txt

+4
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,10 @@ set(CMAKE_INSTALL_RPATH "$ORIGIN")
3838

3939
# Set the option prefix to match the outer project before including. Must be before find_package(morpheus)
4040
set(OPTION_PREFIX "MORPHEUS")
41+
42+
# Set the policy to allow for CMP0144, avoids warning about MORPHEUS_ROOT being set
43+
cmake_policy(SET CMP0144 NEW)
44+
4145
find_package(morpheus REQUIRED)
4246

4347
morpheus_utils_initialize_cpm(MORPHEUS_CACHE_DIR)

examples/developer_guide/4_rabbitmq_cpp_stage/CMakeLists.txt

+4
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,10 @@ set(CMAKE_EXPORT_COMPILE_COMMANDS ON)
3838

3939
# Set the option prefix to match the outer project before including. Must be before find_package(morpheus)
4040
set(OPTION_PREFIX "MORPHEUS")
41+
42+
# Set the policy to allow for CMP0144, avoids warning about MORPHEUS_ROOT being set
43+
cmake_policy(SET CMP0144 NEW)
44+
4145
find_package(morpheus REQUIRED)
4246

4347
morpheus_utils_initialize_cpm(MORPHEUS_CACHE_DIR)

python/morpheus/morpheus/_lib/cmake/libmorpheus.cmake

+3
Original file line numberDiff line numberDiff line change
@@ -112,6 +112,9 @@ add_dependencies(morpheus ${cudf_helpers_target})
112112
# In debug mode, dont allow missing symbols
113113
target_link_options(morpheus PUBLIC "$<$<CONFIG:Debug>:-Wl,--no-allow-shlib-undefined>")
114114

115+
# Avoid warning from the lto-wrapper about serial compilation
116+
target_link_options(morpheus PUBLIC "-flto=auto")
117+
115118
# Generates an include file for specifying external linkage since everything is hidden by default
116119
generate_export_header(morpheus
117120
NO_EXPORT_MACRO_NAME

python/morpheus_llm/morpheus_llm/_lib/cmake/libmorpheus_llm.cmake

+3
Original file line numberDiff line numberDiff line change
@@ -60,6 +60,9 @@ target_include_directories(morpheus_llm
6060
# In debug mode, dont allow missing symbols
6161
target_link_options(morpheus_llm PUBLIC "$<$<CONFIG:Debug>:-Wl,--no-allow-shlib-undefined>")
6262

63+
# Avoid warning from the lto-wrapper about serial compilation
64+
target_link_options(morpheus_llm PUBLIC "-flto=auto")
65+
6366
# Ideally, we dont use glob here. But there is no good way to guarantee you dont miss anything like *.cpp
6467
file(GLOB_RECURSE morpheus_llm_public_headers
6568
LIST_DIRECTORIES FALSE

0 commit comments

Comments
 (0)