OLD | NEW |
1 // Copyright (c) 2013 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2013 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #include "tools/gn/ninja_binary_target_writer.h" | 5 #include "tools/gn/ninja_binary_target_writer.h" |
6 | 6 |
7 #include <sstream> | 7 #include <sstream> |
8 #include <utility> | 8 #include <utility> |
9 | 9 |
10 #include "testing/gtest/include/gtest/gtest.h" | 10 #include "testing/gtest/include/gtest/gtest.h" |
(...skipping 754 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
765 "build withpch/obj/foo/no_pch_target.stamp: " | 765 "build withpch/obj/foo/no_pch_target.stamp: " |
766 "withpch_stamp withpch/obj/foo/no_pch_target.input1.o " | 766 "withpch_stamp withpch/obj/foo/no_pch_target.input1.o " |
767 "withpch/obj/foo/no_pch_target.input2.o\n"; | 767 "withpch/obj/foo/no_pch_target.input2.o\n"; |
768 EXPECT_EQ(no_pch_expected, out.str()); | 768 EXPECT_EQ(no_pch_expected, out.str()); |
769 } | 769 } |
770 | 770 |
771 // This target specifies PCH. | 771 // This target specifies PCH. |
772 { | 772 { |
773 Target pch_target(&pch_settings, | 773 Target pch_target(&pch_settings, |
774 Label(SourceDir("//foo/"), "pch_target")); | 774 Label(SourceDir("//foo/"), "pch_target")); |
775 pch_target.config_values().set_precompiled_header("build/precompile.h"); | |
776 pch_target.config_values().set_precompiled_source( | 775 pch_target.config_values().set_precompiled_source( |
777 SourceFile("//build/precompile.h")); | 776 SourceFile("//build/precompile.h")); |
778 pch_target.config_values().cflags_c().push_back("-std=c99"); | 777 pch_target.config_values().cflags_c().push_back("-std=c99"); |
779 pch_target.set_output_type(Target::SOURCE_SET); | 778 pch_target.set_output_type(Target::SOURCE_SET); |
780 pch_target.visibility().SetPublic(); | 779 pch_target.visibility().SetPublic(); |
781 pch_target.sources().push_back(SourceFile("//foo/input1.cc")); | 780 pch_target.sources().push_back(SourceFile("//foo/input1.cc")); |
782 pch_target.sources().push_back(SourceFile("//foo/input2.c")); | 781 pch_target.sources().push_back(SourceFile("//foo/input2.c")); |
783 pch_target.SetToolchain(&pch_toolchain); | 782 pch_target.SetToolchain(&pch_toolchain); |
784 ASSERT_TRUE(pch_target.OnResolved(&err)); | 783 ASSERT_TRUE(pch_target.OnResolved(&err)); |
785 | 784 |
(...skipping 127 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
913 " | obj/foo/bar.inputs.stamp\n" | 912 " | obj/foo/bar.inputs.stamp\n" |
914 "build obj/foo/bar.input2.o: cxx ../../foo/input2.cc" | 913 "build obj/foo/bar.input2.o: cxx ../../foo/input2.cc" |
915 " | obj/foo/bar.inputs.stamp\n" | 914 " | obj/foo/bar.inputs.stamp\n" |
916 "\n" | 915 "\n" |
917 "build obj/foo/bar.stamp: stamp obj/foo/bar.input1.o " | 916 "build obj/foo/bar.stamp: stamp obj/foo/bar.input1.o " |
918 "obj/foo/bar.input2.o\n"; | 917 "obj/foo/bar.input2.o\n"; |
919 | 918 |
920 EXPECT_EQ(expected, out.str()); | 919 EXPECT_EQ(expected, out.str()); |
921 } | 920 } |
922 } | 921 } |
OLD | NEW |