2
0
mirror of https://github.com/boostorg/build.git synced 2026-02-11 11:42:14 +00:00
Files
build/test/c_file.py
Vladimir Prus 58f0dbb5cd Compile C files with C compiler, not C++. This commit would close BB32, if
it included MSVC...

* new/toolset.jam:
  Allow action names with dots, so that we can set flags for
   gcc.compile.c, gcc.compile and gcc and combine those flags.

* tools/gcc.jam: Use 'gcc' for compiling C files. There's still a problem:
   'init' rules does not allow to configure name of C compiler. Also, don't
   declare flags individually for gcc.link and gcc.link-dll.

* tools/borland.jam: Force C++ compile when needed.


[SVN r18774]
2003-06-11 08:40:45 +00:00

35 lines
797 B
Python

#!/usr/bin/python
# Copyright (C) Vladimir Prus 2003. Permission to copy, use, modify, sell and
# distribute this software is granted provided this copyright notice appears in
# all copies. This software is provided "as is" without express or implied
# warranty, and with no claim as to its suitability for any purpose.
# Test that C files are compiled by C compiler
from BoostBuild import Tester, List
t = Tester()
t.write("project-root.jam", """
project ;
exe hello : hello.cpp a.c ;
""")
t.write("hello.cpp", """
extern "C" int foo();
int main() { return foo(); }
""")
t.write("a.c", """
// This won't compile unless in C mode
int foo()
{
int new = 0;
new = (new+1)*7;
return new;
}
""")
t.run_build_system()
t.expect_addition("bin/$toolset/debug/hello.exe")
t.cleanup()