Skip to content

Commit c49a8e2

Browse files
committed
build: setting of "-Wno-unused-result" flag moved to a different CMake file
1 parent c2672c0 commit c49a8e2

File tree

2 files changed

+9
-7
lines changed

2 files changed

+9
-7
lines changed

CMakeLists.txt

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -84,10 +84,3 @@ endif()
8484
# add unit tests
8585
enable_testing()
8686
add_subdirectory(test)
87-
88-
# TODO remove this hack when clang-20.2 is released
89-
if(CMAKE_CXX_COMPILER_ID MATCHES ".*Clang" AND CMAKE_CXX_COMPILER_VERSION VERSION_GREATER 20
90-
AND CMAKE_CXX_COMPILER_VERSION VERSION_LESS 20.2
91-
)
92-
target_compile_options(mp-units-core PUBLIC "-Wno-unused-result")
93-
endif()

src/core/CMakeLists.txt

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -156,6 +156,15 @@ target_compile_definitions(
156156
${projectPrefix}HOSTED=$<NOT:$<BOOL:${${projectPrefix}API_FREESTANDING}>>
157157
)
158158

159+
160+
# TODO remove this hack when clang-20.2 is released
161+
if(CMAKE_CXX_COMPILER_ID MATCHES ".*Clang" AND CMAKE_CXX_COMPILER_VERSION VERSION_GREATER 20
162+
AND CMAKE_CXX_COMPILER_VERSION VERSION_LESS 20.2
163+
)
164+
target_compile_options(mp-units-core ${${projectPrefix}TARGET_SCOPE} "-Wno-unused-result")
165+
endif()
166+
167+
# time-trace
159168
if(${projectPrefix}DEV_TIME_TRACE STREQUAL "ALL")
160169
target_compile_options(mp-units-core ${${projectPrefix}TARGET_SCOPE} "-ftime-trace")
161170
elseif(${projectPrefix}DEV_TIME_TRACE STREQUAL "MODULES")

0 commit comments

Comments
 (0)