author | erikj |
Fri, 30 Sep 2016 09:06:02 +0200 | |
changeset 41193 | 9e274c9c3047 |
parent 39991 | d89a486fa0d2 |
child 41465 | 2b9154b407e6 |
permissions | -rw-r--r-- |
38255 | 1 |
# |
2 |
# Copyright (c) 2016, Oracle and/or its affiliates. All rights reserved. |
|
3 |
# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. |
|
4 |
# |
|
5 |
# This code is free software; you can redistribute it and/or modify it |
|
6 |
# under the terms of the GNU General Public License version 2 only, as |
|
7 |
# published by the Free Software Foundation. Oracle designates this |
|
8 |
# particular file as subject to the "Classpath" exception as provided |
|
9 |
# by Oracle in the LICENSE file that accompanied this code. |
|
10 |
# |
|
11 |
# This code is distributed in the hope that it will be useful, but WITHOUT |
|
12 |
# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or |
|
13 |
# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License |
|
14 |
# version 2 for more details (a copy is included in the LICENSE file that |
|
15 |
# accompanied this code). |
|
16 |
# |
|
17 |
# You should have received a copy of the GNU General Public License version |
|
18 |
# 2 along with this work; if not, write to the Free Software Foundation, |
|
19 |
# Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. |
|
20 |
# |
|
21 |
# Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA |
|
22 |
# or visit www.oracle.com if you need additional information or have any |
|
23 |
# questions. |
|
24 |
# |
|
25 |
||
39393 | 26 |
$(eval $(call IncludeCustomExtension, hotspot, lib/CompileGtest.gmk)) |
27 |
||
28 |
GTEST_TEST_SRC += $(HOTSPOT_TOPDIR)/test/native |
|
29 |
GTEST_LAUNCHER_SRC := $(HOTSPOT_TOPDIR)/test/native/gtestLauncher.cpp |
|
38255 | 30 |
GTEST_FRAMEWORK_SRC := $(SRC_ROOT)/test/fmw/gtest |
31 |
||
32 |
# On Windows, there are no internal debug symbols so must set copying to true |
|
33 |
# to get any at all. |
|
34 |
ifeq ($(OPENJDK_TARGET_OS), windows) |
|
35 |
GTEST_COPY_DEBUG_SYMBOLS := true |
|
36 |
else |
|
37 |
GTEST_COPY_DEBUG_SYMBOLS := false |
|
38 |
endif |
|
39 |
||
40 |
################################################################################ |
|
41 |
||
42 |
ifeq ($(OPENJDK_TARGET_OS), windows) |
|
43 |
GTEST_JVM_MAPFILE := $(JVM_MAPFILE) |
|
44 |
else |
|
45 |
GTEST_JVM_MAPFILE := $(JVM_OUTPUTDIR)/gtest/mapfile |
|
46 |
||
47 |
$(JVM_OUTPUTDIR)/gtest/symbols: $(JVM_OUTPUTDIR)/symbols |
|
48 |
$(call MakeDir, $(@D)) |
|
49 |
( $(CAT) $< ; echo "runUnitTests" ) > $@ |
|
50 |
||
51 |
$(GTEST_JVM_MAPFILE): $(JVM_OUTPUTDIR)/gtest/symbols |
|
52 |
$(call create-mapfile) |
|
53 |
endif |
|
54 |
||
55 |
# Disabling switch warning for clang because of test source. |
|
56 |
||
57 |
$(eval $(call SetupNativeCompilation, BUILD_GTEST_LIBJVM, \ |
|
41193
9e274c9c3047
8160630: libjimage.so and others should link statically to libgcc
erikj
parents:
39991
diff
changeset
|
58 |
TOOLCHAIN := TOOLCHAIN_LINK_CXX, \ |
38255 | 59 |
LIBRARY := jvm, \ |
60 |
OUTPUT_DIR := $(JVM_OUTPUTDIR)/gtest, \ |
|
61 |
OBJECT_DIR := $(JVM_OUTPUTDIR)/gtest/objs, \ |
|
38636
0a04aee4e7a6
8157325: gtest tests are not excluded for minimal builds
ehelin
parents:
38255
diff
changeset
|
62 |
SRC := $(GTEST_TEST_SRC), \ |
0a04aee4e7a6
8157325: gtest tests are not excluded for minimal builds
ehelin
parents:
38255
diff
changeset
|
63 |
EXCLUDES := $(JVM_EXCLUDES), \ |
0a04aee4e7a6
8157325: gtest tests are not excluded for minimal builds
ehelin
parents:
38255
diff
changeset
|
64 |
EXCLUDE_FILES := gtestLauncher.cpp, \ |
0a04aee4e7a6
8157325: gtest tests are not excluded for minimal builds
ehelin
parents:
38255
diff
changeset
|
65 |
EXCLUDE_PATTERNS := $(JVM_EXCLUDE_PATTERNS), \ |
0a04aee4e7a6
8157325: gtest tests are not excluded for minimal builds
ehelin
parents:
38255
diff
changeset
|
66 |
EXTRA_FILES := $(GTEST_FRAMEWORK_SRC)/src/gtest-all.cc, \ |
38255 | 67 |
EXTRA_OBJECT_FILES := $(filter-out %/operator_new$(OBJ_SUFFIX), \ |
68 |
$(BUILD_LIBJVM_ALL_OBJS)), \ |
|
69 |
CFLAGS := $(JVM_CFLAGS) -I$(GTEST_FRAMEWORK_SRC) \ |
|
70 |
-I$(GTEST_FRAMEWORK_SRC)/include \ |
|
39393 | 71 |
$(addprefix -I,$(GTEST_TEST_SRC)), \ |
38255 | 72 |
CFLAGS_windows := /EHsc, \ |
73 |
CFLAGS_solaris := -DGTEST_HAS_EXCEPTIONS=0 -library=stlport4, \ |
|
74 |
CFLAGS_macosx := -DGTEST_OS_MAC=1, \ |
|
75 |
CFLAGS_DEBUG_SYMBOLS := $(JVM_CFLAGS_SYMBOLS), \ |
|
76 |
CXXFLAGS_DEBUG_SYMBOLS := $(JVM_CFLAGS_SYMBOLS), \ |
|
77 |
DISABLED_WARNINGS_gcc := undef, \ |
|
78 |
DISABLED_WARNINGS_clang := undef switch format-nonliteral \ |
|
39394 | 79 |
tautological-undefined-compare $(BUILD_LIBJVM_DISABLED_WARNINGS_clang), \ |
38255 | 80 |
DISABLED_WARNINGS_solstudio := identexpected, \ |
81 |
LDFLAGS := $(JVM_LDFLAGS), \ |
|
82 |
LDFLAGS_solaris := -library=stlport4 $(call SET_SHARED_LIBRARY_ORIGIN), \ |
|
83 |
LIBS := $(JVM_LIBS), \ |
|
84 |
OPTIMIZATION := $(JVM_OPTIMIZATION), \ |
|
85 |
MAPFILE := $(GTEST_JVM_MAPFILE), \ |
|
86 |
USE_MAPFILE_FOR_SYMBOLS := true, \ |
|
87 |
COPY_DEBUG_SYMBOLS := $(GTEST_COPY_DEBUG_SYMBOLS), \ |
|
88 |
ZIP_EXTERNAL_DEBUG_SYMBOLS := false, \ |
|
39394 | 89 |
PRECOMPILED_HEADER := $(JVM_PRECOMPILED_HEADER), \ |
90 |
PRECOMPILED_HEADER_EXCLUDE := gtest-all.cc gtestMain.cpp, \ |
|
38255 | 91 |
)) |
92 |
||
93 |
TARGETS += $(BUILD_GTEST_LIBJVM) |
|
94 |
||
95 |
################################################################################ |
|
96 |
||
97 |
$(eval $(call SetupNativeCompilation, BUILD_GTEST_LAUNCHER, \ |
|
41193
9e274c9c3047
8160630: libjimage.so and others should link statically to libgcc
erikj
parents:
39991
diff
changeset
|
98 |
TOOLCHAIN := TOOLCHAIN_LINK_CXX, \ |
38255 | 99 |
PROGRAM := gtestLauncher, \ |
100 |
OUTPUT_DIR := $(JVM_OUTPUTDIR)/gtest, \ |
|
39393 | 101 |
EXTRA_FILES := $(GTEST_LAUNCHER_SRC), \ |
38255 | 102 |
OBJECT_DIR := $(JVM_OUTPUTDIR)/gtest/launcher-objs, \ |
103 |
CFLAGS := $(JVM_CFLAGS) -I$(GTEST_FRAMEWORK_SRC) \ |
|
104 |
-I$(GTEST_FRAMEWORK_SRC)/include, \ |
|
105 |
CFLAGS_DEBUG_SYMBOLS := $(JVM_CFLAGS_SYMBOLS), \ |
|
106 |
CXXFLAGS_DEBUG_SYMBOLS := $(JVM_CFLAGS_SYMBOLS), \ |
|
39991
d89a486fa0d2
8161915: Linking gtestLauncher may end up linking with non-gtest libjvm
mgerdin
parents:
39394
diff
changeset
|
107 |
LDFLAGS := $(LDFLAGS_JDKEXE), \ |
38255 | 108 |
LDFLAGS_unix := -L$(JVM_OUTPUTDIR)/gtest $(call SET_SHARED_LIBRARY_ORIGIN), \ |
109 |
LDFLAGS_solaris := -library=stlport4, \ |
|
110 |
LIBS_unix := -ljvm, \ |
|
111 |
LIBS_windows := $(JVM_OUTPUTDIR)/gtest/objs/jvm.lib, \ |
|
112 |
COPY_DEBUG_SYMBOLS := $(GTEST_COPY_DEBUG_SYMBOLS), \ |
|
113 |
ZIP_EXTERNAL_DEBUG_SYMBOLS := false, \ |
|
114 |
)) |
|
115 |
||
116 |
$(BUILD_GTEST_LAUNCHER): $(BUILD_GTEST_LIBJVM) |
|
117 |
||
118 |
TARGETS += $(BUILD_GTEST_LAUNCHER) |
|
119 |
||
120 |
################################################################################ |