Path: blob/master/runtime/j9vm31/CMakeLists.txt
5985 views
################################################################################1# Copyright (c) 2021, 2021 IBM Corp. and others2#3# This program and the accompanying materials are made available under4# the terms of the Eclipse Public License 2.0 which accompanies this5# distribution and is available at https://www.eclipse.org/legal/epl-2.0/6# or the Apache License, Version 2.0 which accompanies this distribution and7# is available at https://www.apache.org/licenses/LICENSE-2.0.8#9# This Source Code may also be made available under the following10# Secondary Licenses when the conditions for such availability set11# forth in the Eclipse Public License, v. 2.0 are satisfied: GNU12# General Public License, version 2 with the GNU Classpath13# Exception [1] and GNU General Public License, version 2 with the14# OpenJDK Assembly Exception [2].15#16# [1] https://www.gnu.org/software/classpath/license.html17# [2] http://openjdk.java.net/legal/assembly-exception.html18#19# 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-exception20################################################################################2122set(OMR_ENHANCED_WARNINGS OFF)2324# libjvm31 is a standalone 31-bit shim library in what is otherwise a 64-bit build.25add_library(jvm31 SHARED26j9cel4ro64.c27j9vm31floatstubs.s28jnicgen.cpp29jnicsup.cpp30jnifield.cpp31jniinv.cpp32jnimisc.cpp33jnireflect.cpp34)3536# Note: These include directories need to be declared ahead of the removals of compile flags37# below, otherwise, the directories will not be added.38target_include_directories(jvm3139PRIVATE40# Use the include31 with the generated header artifacts.41${CMAKE_CURRENT_BINARY_DIR}/../include3142# Explicitly include OMR's include directories, instead of linking to INTERFACE, to ensure43# we don't pick up other 64-bit linking dependencies.44${omr_SOURCE_DIR}/include_core45${CMAKE_CURRENT_BINARY_DIR}/../omr46)47add_dependencies(jvm31 j9vm31_m4gen)4849include(exports.cmake)5051# Need to remove XPLINK and 64-bit compile and link options, as libjvm31 needs to be a 31-bit Standard Linkage library.5253# Flags to be removed when compiling.54set(compile_flags_to_remove55"\"-Wc,xplink\""56"-Wc,lp64"57"\"-Wa,SYSPARM(BIT64)\""58"-DJ9ZOS39064"59"-qxplink=noback"60)6162foreach(flag IN LISTS compile_flags_to_remove)63omr_remove_flags(CMAKE_C_FLAGS "${flag}")64omr_remove_flags(CMAKE_CXX_FLAGS "${flag}")65omr_remove_flags(CMAKE_ASM_FLAGS "${flag}")66endforeach()6768# Flags to be removed when linking.69set(link_flags_to_remove70"-Wl,xplink"71"-Wl,lp64"72)7374foreach(flag IN LISTS link_flags_to_remove)75omr_remove_flags(CMAKE_SHARED_LINKER_FLAGS "${flag}")76endforeach()7778install(79TARGETS jvm3180LIBRARY DESTINATION ${j9vm_SOURCE_DIR}81RUNTIME DESTINATION ${j9vm_SOURCE_DIR}82)838485