mirror of
https://github.com/boostorg/build.git
synced 2026-01-19 16:12:14 +00:00
Run C preprocessor on assembly source files. Brings gcc-derived toolset behavior to every toolset.
41 lines
941 B
Python
41 lines
941 B
Python
#!/usr/bin/python
|
|
|
|
# Copyright 2023 Nikita Kniazev
|
|
# Distributed under the Boost Software License, Version 1.0.
|
|
# (See accompanying file LICENSE.txt or https://www.bfgroup.xyz/b2/LICENSE.txt)
|
|
|
|
# Test that assembler file is actually C-preprocessed.
|
|
|
|
import BoostBuild
|
|
|
|
t = BoostBuild.Tester(use_test_config=False)
|
|
|
|
t.write("jamroot.jam", """\
|
|
obj hello : hello.S : <define>OK ;
|
|
""")
|
|
|
|
'''
|
|
'''
|
|
t.write("hello.S", """\
|
|
#ifndef __ASSEMBLER__
|
|
# error __ASSEMBLER__ expected to be defined
|
|
#endif
|
|
#if __ASSEMBLER__ != 1
|
|
# error __ASSEMBLER__ expected to be defined to value of 1
|
|
#endif
|
|
#ifndef OK
|
|
# error OK was not defined
|
|
#endif
|
|
// MASM/ARMASM requires END token at the end of the file
|
|
#ifdef __GNUC__
|
|
# define END
|
|
#endif
|
|
// whitespace before END is to stop MARMASM from barking 'warning A4045: missing END directive'
|
|
END
|
|
""")
|
|
|
|
t.run_build_system(["-d+2", "--debug-configuration"])
|
|
t.expect_addition("bin/$toolset/debug*/hello.obj")
|
|
|
|
t.cleanup()
|