source_locations.py 1.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142
  1. #!/usr/bin/python
  2. # Copyright (C) Craig Rodrigues 2005.
  3. # Distributed under the Boost Software License, Version 1.0. (See
  4. # accompanying file LICENSE.txt or copy at
  5. # https://www.bfgroup.xyz/b2/LICENSE.txt)
  6. # Test that projects with multiple source-location directories are handled OK.
  7. import BoostBuild
  8. t = BoostBuild.Tester(use_test_config=False)
  9. t.write("jamroot.jam", """
  10. path-constant SRC1 : "./src1" ;
  11. path-constant SRC2 : "./src2" ;
  12. path-constant SRC3 : "./src3" ;
  13. path-constant BUILD : "build" ;
  14. project : requirements <include>$(SRC1)/include <threading>multi
  15. : build-dir $(BUILD) ;
  16. build-project project1 ;
  17. """)
  18. t.write("project1/jamfile.jam", """
  19. project project1 : source-location $(SRC1) $(SRC2) $(SRC3) ;
  20. SRCS = s1.cpp s2.cpp testfoo.cpp ;
  21. exe test : $(SRCS) ;
  22. """)
  23. t.write("src1/s1.cpp", "int main() {}\n")
  24. t.write("src2/s2.cpp", "void hello() {}\n")
  25. t.write("src3/testfoo.cpp", "void testfoo() {}\n")
  26. # This file should not be picked up, because "src2" is before "src3" in the list
  27. # of source directories.
  28. t.write("src3/s2.cpp", "void hello() {}\n")
  29. t.run_build_system()
  30. t.cleanup()