Skip to content

Commit bd0f28d

Browse files
committed
Stop removing - from flags, use log.deprecated
1 parent 96acb98 commit bd0f28d

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

easybuild/tools/toolchain/compiler.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@
3333
* Damian Alvarez (Forschungszentrum Juelich GmbH)
3434
"""
3535
from easybuild.tools import systemtools
36-
from easybuild.tools.build_log import EasyBuildError, print_warning
36+
from easybuild.tools.build_log import EasyBuildError
3737
from easybuild.tools.config import build_option
3838
from easybuild.tools.toolchain.constants import COMPILER_VARIABLES
3939
from easybuild.tools.toolchain.toolchain import Toolchain
@@ -299,7 +299,7 @@ def _set_compiler_flags(self):
299299
extraflags = self.options.option(extra)
300300
if not extraflags or extraflags[0] != '-':
301301
raise EasyBuildError("toolchainopts %s: '%s' must start with a '-'." % (extra, extraflags))
302-
self.variables.nappend_el(var, extraflags[1:])
302+
self.variables.nappend_el(var, extraflags)
303303

304304
def _set_optimal_architecture(self, default_optarch=None):
305305
"""
@@ -356,8 +356,8 @@ def _set_optimal_architecture(self, default_optarch=None):
356356
optarch = self.COMPILER_OPTIMAL_ARCHITECTURE_OPTION[(self.arch, self.cpu_family)]
357357

358358
if optarch is not None:
359-
if not optarch.startswith('-'):
360-
print_warning(f'Specifying optarch "{optarch}" without initial dash is deprecated in EasyBuild 5.')
359+
if optarch and not optarch.startswith('-'):
360+
self.log.deprecated(f'Specifying optarch "{optarch}" without initial dash is deprecated.', '6.0')
361361
# Add flags for backwards compatibility
362362
optarch = '-' + optarch
363363

0 commit comments

Comments
 (0)