Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
PojavLauncherTeam
GitHub Repository: PojavLauncherTeam/openj9
Path: blob/master/runtime/j9vm31/CMakeLists.txt
5985 views
1
################################################################################
2
# Copyright (c) 2021, 2021 IBM Corp. and others
3
#
4
# This program and the accompanying materials are made available under
5
# the terms of the Eclipse Public License 2.0 which accompanies this
6
# distribution and is available at https://www.eclipse.org/legal/epl-2.0/
7
# or the Apache License, Version 2.0 which accompanies this distribution and
8
# is available at https://www.apache.org/licenses/LICENSE-2.0.
9
#
10
# This Source Code may also be made available under the following
11
# Secondary Licenses when the conditions for such availability set
12
# forth in the Eclipse Public License, v. 2.0 are satisfied: GNU
13
# General Public License, version 2 with the GNU Classpath
14
# Exception [1] and GNU General Public License, version 2 with the
15
# OpenJDK Assembly Exception [2].
16
#
17
# [1] https://www.gnu.org/software/classpath/license.html
18
# [2] http://openjdk.java.net/legal/assembly-exception.html
19
#
20
# SPDX-License-Identifier: EPL-2.0 OR Apache-2.0 OR GPL-2.0 WITH Classpath-exception-2.0 OR LicenseRef-GPL-2.0 WITH Assembly-exception
21
################################################################################
22
23
set(OMR_ENHANCED_WARNINGS OFF)
24
25
# libjvm31 is a standalone 31-bit shim library in what is otherwise a 64-bit build.
26
add_library(jvm31 SHARED
27
j9cel4ro64.c
28
j9vm31floatstubs.s
29
jnicgen.cpp
30
jnicsup.cpp
31
jnifield.cpp
32
jniinv.cpp
33
jnimisc.cpp
34
jnireflect.cpp
35
)
36
37
# Note: These include directories need to be declared ahead of the removals of compile flags
38
# below, otherwise, the directories will not be added.
39
target_include_directories(jvm31
40
PRIVATE
41
# Use the include31 with the generated header artifacts.
42
${CMAKE_CURRENT_BINARY_DIR}/../include31
43
# Explicitly include OMR's include directories, instead of linking to INTERFACE, to ensure
44
# we don't pick up other 64-bit linking dependencies.
45
${omr_SOURCE_DIR}/include_core
46
${CMAKE_CURRENT_BINARY_DIR}/../omr
47
)
48
add_dependencies(jvm31 j9vm31_m4gen)
49
50
include(exports.cmake)
51
52
# Need to remove XPLINK and 64-bit compile and link options, as libjvm31 needs to be a 31-bit Standard Linkage library.
53
54
# Flags to be removed when compiling.
55
set(compile_flags_to_remove
56
"\"-Wc,xplink\""
57
"-Wc,lp64"
58
"\"-Wa,SYSPARM(BIT64)\""
59
"-DJ9ZOS39064"
60
"-qxplink=noback"
61
)
62
63
foreach(flag IN LISTS compile_flags_to_remove)
64
omr_remove_flags(CMAKE_C_FLAGS "${flag}")
65
omr_remove_flags(CMAKE_CXX_FLAGS "${flag}")
66
omr_remove_flags(CMAKE_ASM_FLAGS "${flag}")
67
endforeach()
68
69
# Flags to be removed when linking.
70
set(link_flags_to_remove
71
"-Wl,xplink"
72
"-Wl,lp64"
73
)
74
75
foreach(flag IN LISTS link_flags_to_remove)
76
omr_remove_flags(CMAKE_SHARED_LINKER_FLAGS "${flag}")
77
endforeach()
78
79
install(
80
TARGETS jvm31
81
LIBRARY DESTINATION ${j9vm_SOURCE_DIR}
82
RUNTIME DESTINATION ${j9vm_SOURCE_DIR}
83
)
84
85