Skip to content

Commit dfb0eeb

Browse files
committed
build: Wno-error=unused-command-line-argument added for clang modules build
1 parent 95a2d22 commit dfb0eeb

File tree

1 file changed

+11
-8
lines changed

1 file changed

+11
-8
lines changed

src/core/CMakeLists.txt

Lines changed: 11 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -129,27 +129,30 @@ if(MP_UNITS_BUILD_CXX_MODULES)
129129
endif()
130130

131131
if(CMAKE_CXX_COMPILER_VERSION VERSION_GREATER_EQUAL 18)
132-
target_compile_options(mp-units-core PUBLIC "-Wno-include-angled-in-module-purview")
132+
target_compile_options(
133+
mp-units-core PUBLIC -Wno-include-angled-in-module-purview
134+
-Wno-error=unused-command-line-argument
135+
)
133136
endif()
134137

135138
# Clang-18 has a known bug where pragmas don't work correctly inside C++ modules
136139
# and we need to silent truncation warnings in sudo_cast
137140
if(CMAKE_CXX_COMPILER_VERSION VERSION_LESS 19)
138-
target_compile_options(mp-units-core PUBLIC "-Wno-error=implicit-float-conversion")
141+
target_compile_options(mp-units-core PUBLIC -Wno-error=implicit-float-conversion)
139142
endif()
140143
endif()
141144

142145
if(CMAKE_CXX_COMPILER_ID STREQUAL "MSVC")
143146
# '#include <filename>' in the purview of module 'module-name-1' appears erroneous
144-
target_compile_options(mp-units-core PUBLIC "/wd5244")
147+
target_compile_options(mp-units-core PUBLIC /wd5244)
145148
endif()
146149
endif()
147150

148151
if(CMAKE_CXX_MODULE_STD)
149152
target_compile_definitions(mp-units-core ${MP_UNITS_TARGET_SCOPE} MP_UNITS_IMPORT_STD)
150153
# https://github.com/llvm/llvm-project/issues/75057
151154
if(CMAKE_CXX_COMPILER_ID STREQUAL "Clang" AND CMAKE_CXX_COMPILER_VERSION VERSION_LESS 19)
152-
target_compile_options(mp-units-core ${MP_UNITS_TARGET_SCOPE} "-Wno-deprecated-declarations")
155+
target_compile_options(mp-units-core ${MP_UNITS_TARGET_SCOPE} -Wno-deprecated-declarations)
153156
endif()
154157
endif()
155158

@@ -178,17 +181,17 @@ endif()
178181
if(CMAKE_CXX_COMPILER_ID STREQUAL "Clang" AND CMAKE_CXX_COMPILER_VERSION VERSION_GREATER 20
179182
AND CMAKE_CXX_COMPILER_VERSION VERSION_LESS 20.2
180183
)
181-
target_compile_options(mp-units-core ${MP_UNITS_TARGET_SCOPE} "-Wno-unused-result")
184+
target_compile_options(mp-units-core ${MP_UNITS_TARGET_SCOPE} -Wno-unused-result)
182185
endif()
183186

184187
# usage of uninitialized variable in c++/12/bits/char_traits.h
185188
if(CMAKE_CXX_COMPILER_ID STREQUAL "GNU" AND CMAKE_CXX_COMPILER_VERSION VERSION_LESS 13)
186-
target_compile_options(mp-units-core ${MP_UNITS_TARGET_SCOPE} "-Wno-maybe-uninitialized")
189+
target_compile_options(mp-units-core ${MP_UNITS_TARGET_SCOPE} -Wno-maybe-uninitialized)
187190
endif()
188191

189192
# time-trace
190193
if(MP_UNITS_DEV_TIME_TRACE STREQUAL "ALL")
191-
target_compile_options(mp-units-core ${MP_UNITS_TARGET_SCOPE} "-ftime-trace")
194+
target_compile_options(mp-units-core ${MP_UNITS_TARGET_SCOPE} -ftime-trace)
192195
elseif(MP_UNITS_DEV_TIME_TRACE STREQUAL "MODULES")
193-
target_compile_options(mp-units-core PRIVATE "-ftime-trace")
196+
target_compile_options(mp-units-core PRIVATE -ftime-trace)
194197
endif()

0 commit comments

Comments
 (0)