forked from eclipse-omr/omr
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Initial commit of CMake build system
Adds experimental support for building with cmake Issue: eclipse-omr#933 Also-by: Robert Young <rwy0717@gmail.com> Signed-off-by: Devin Nakamura <devinn@ca.ibm.com>
- Loading branch information
Showing
43 changed files
with
2,598 additions
and
29 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
############################################################################### | ||
# | ||
# (c) Copyright IBM Corp. 2016 | ||
# | ||
# This program and the accompanying materials are made available | ||
# under the terms of the Eclipse Public License v1.0 and | ||
# Apache License v2.0 which accompanies this distribution. | ||
# | ||
# The Eclipse Public License is available at | ||
# http://www.eclipse.org/legal/epl-v10.html | ||
# | ||
# The Apache License v2.0 is available at | ||
# http://www.opensource.org/licenses/apache2.0.php | ||
# | ||
# Contributors: | ||
# Multiple authors (IBM Corp.) - initial implementation and documentation | ||
############################################################################### | ||
|
||
platform: x64 | ||
configuration: Debug | ||
shallow_clone: true | ||
clone_depth: 1 | ||
|
||
environment: | ||
GTEST_FILTER: '*dump_test_create_dump_*:*NumaSetAffinity:*NumaSetAffinitySuspended' | ||
GTEST_COLOR: '1' | ||
|
||
before_build: | ||
- ps: cmake -Wdev -G "Visual Studio 14 2015 Win64" . | ||
|
||
build: | ||
project: omr.sln | ||
parallel: true | ||
|
||
test_script: | ||
- ps: ctest -V -C Debug |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,97 @@ | ||
cmake_minimum_required(VERSION 3.2 FATAL_ERROR) | ||
|
||
set(OMR_VERSION_MAJOR 0) | ||
set(OMR_VERSION_MINOR 0) | ||
set(OMR_VERSION_PATCH 1) | ||
set(OMR_VERSION ${OMR_VERSION_MAJOR}.${OMR_VERSION_MINOR}.${OMR_VERSION_PATCH}) | ||
|
||
project(omr VERSION ${OMR_VERSION} LANGUAGES CXX C) | ||
|
||
set(CMAKE_MODULE_PATH "${CMAKE_SOURCE_DIR}/cmake/modules" ${CMAKE_MODULE_PATH}) | ||
|
||
### | ||
### Getting the glue directory | ||
### | ||
|
||
set(OMR_GLUE "./example/glue" CACHE PATH "The glue directory") | ||
|
||
# TODO: OMR_EXAMPLE flag | ||
# TODO: OMR_RTTI flag | ||
|
||
# TODO: Version things | ||
|
||
set(OMR_VERSION_STRING "<Unknown>" CACHE STRING "") # TODO: Set the version | ||
set(OMR_JIT_VERSION_STRING "<Unknown>" CACHE STRING "") # TODO: Set the version | ||
|
||
### | ||
### Versions and stuff | ||
### | ||
|
||
include(cmake/platform.cmake) | ||
include(cmake/config.cmake) | ||
|
||
enable_testing() | ||
|
||
#include current source dir and current bin dir automatically | ||
set(CMAKE_INCLUDE_CURRENT_DIR ON) | ||
|
||
function(VPathResolve inlist dirlist outlist) | ||
set(output "") | ||
foreach(currentFile ${${inlist}}) | ||
set(fileFound False) | ||
#message("Searching for ${currentFile}") | ||
foreach(currentDir ${${dirlist}}) | ||
#message("looking in ${currentDir}") | ||
#message("${CMAKE_CURRENT_SOURCE_DIR}/${currentDir}/${currentFile}") | ||
if(EXISTS "${CMAKE_CURRENT_SOURCE_DIR}/${currentDir}/${currentFile}") | ||
list(APPEND output "${currentDir}/${currentFile}") | ||
set(fileFound True) | ||
break() | ||
endif() | ||
endforeach() | ||
if(NOT fileFound) | ||
message(FATAL_ERROR "Could not find file ${currentFile}") | ||
endif() | ||
endforeach() | ||
set(${outlist} ${output} PARENT_SCOPE) | ||
endfunction() | ||
|
||
include_directories( | ||
${PROJECT_BINARY_DIR} | ||
./include/ | ||
./include_core/ | ||
./third_party/ | ||
) | ||
|
||
add_definitions( | ||
-DUT_DIRECT_TRACE_REGISTRATION # TODO: Deal with that stupid jni issue in tracegen | ||
) | ||
|
||
configure_file(./omrcfg.CMakeTemplate.h omrcfg.h) | ||
configure_file(./omrversionstrings.CMakeTemplate.h omrversionstrings.h) | ||
|
||
add_subdirectory(tools) | ||
# Yeah, its dumb doing this here. Read note in tools/CMakeLists.txt | ||
if(CMAKE_CROSSCOMPILING) | ||
include(${OMR_TOOLS_IMPORTFILE}) | ||
endif() | ||
add_subdirectory(thread) | ||
add_subdirectory(port) | ||
add_subdirectory(util) | ||
add_subdirectory(omrtrace) | ||
add_subdirectory(omr) | ||
add_subdirectory(third_party) | ||
add_subdirectory(omrsigcompat) | ||
|
||
#TODO should be wrapped in if() | ||
add_subdirectory(fvtest) | ||
|
||
if(OMR_GC) | ||
add_subdirectory(gc) | ||
add_subdirectory("${OMR_GLUE}") | ||
endif(OMR_GC) | ||
|
||
if(OMR_COMPILER) | ||
# TODO: Actually support the compiler | ||
add_subdirectory(compiler) | ||
endif(OMR_COMPILER) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
set(OMR_EXAMPLE ON CACHE BOOL "") | ||
set(OMR_JIT ON CACHE BOOL "") | ||
set(OMR_GC ON CACHE BOOL "") | ||
set(OMR_PORT ON CACHE BOOL "") | ||
set(OMR_THREAD ON CACHE BOOL "") | ||
set(OMR_OMRSIG ON CACHE BOOL "") | ||
set(OMR_FVTEST ON CACHE BOOL "") | ||
set(OMR_GLUE ${CMAKE_SOURCE_DIR}/example/glue) | ||
set(OMR_GC_SEGREGATED_HEAP ON CACHE BOOL "") | ||
set(OMR_GC_MODRON_SCAVENGER ON CACHE BOOL "") | ||
set(OMR_GC_MODRON_CONCURRENT_MARK ON CACHE BOOL "") | ||
set(OMR_THR_CUSTOM_SPIN_OPTIONS ON CACHE BOOL "") | ||
set(OMR_NOTIFY_POLICY_CONTROL ON CACHE BOOL "") | ||
set(OMR_THR_SPIN_WAKE_CONTROL ON CACHE BOOL "") | ||
set(OMR_THR_SPIN_CODE_REFACTOR ON CACHE BOOL "") |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,102 @@ | ||
|
||
### | ||
### Major Feature Flags | ||
### | ||
|
||
set(OMR_GC ON CACHE BOOL "Enable the GC") | ||
set(OMR_COMPILER OFF CACHE BOOL "Enable the compiler") | ||
set(OMR_JITBUILDER OFF CACHE BOOL "Enable building JitBuilder") | ||
set(OMR_TEST_COMPILER OFF CACHE BOOL "Enable building the test compiler") | ||
set(OMR_PORT ON CACHE BOOL "Enable portability library") | ||
set(OMR_THREAD ON CACHE BOOL "Enable thread library") | ||
set(OMR_OMRSIG ON CACHE BOOL "Enable the OMR signal compatibility library") | ||
# set(OMR_TOOLS On CACHE BOOL "Enable the build tools") | ||
# TODO: Support building only tools for cross-compilation build | ||
|
||
|
||
|
||
### | ||
### Boolean Feature Flags | ||
### | ||
|
||
# TODO: This is a pretty crazy list, can we move it to their subprojects? | ||
|
||
set(OMR_GC_ALLOCATION_TAX ON CACHE BOOL "TODO: Document") | ||
set(OMR_GC_ARRAYLETS ON CACHE BOOL "TODO: Document") | ||
set(OMR_GC_BATCH_CLEAR_TLH ON CACHE BOOL "TODO: Document") | ||
set(OMR_GC_COMBINATION_SPEC ON CACHE BOOL "TODO: Document") | ||
set(OMR_GC_DEBUG_ASSERTS ON CACHE BOOL "TODO: Document") | ||
set(OMR_GC_HEAP_CARD_TABLE ON CACHE BOOL "TODO: Document") | ||
set(OMR_GC_LARGE_OBJECT_AREA ON CACHE BOOL "TODO: Document") | ||
set(OMR_GC_MINIMUM_OBJECT_SIZE ON CACHE BOOL "TODO: Document") | ||
set(OMR_GC_MODRON_STANDARD ON CACHE BOOL "TODO: Document") | ||
set(OMR_GC_NON_ZERO_TLH ON CACHE BOOL "TODO: Document") | ||
set(OMR_GC_THREAD_LOCAL_HEAP ON CACHE BOOL "TODO: Document") | ||
set(OMR_GC_COMPRESSED_POINTERS OFF CACHE BOOL "TODO: Document") | ||
set(OMR_GC_TLH_PREFETCH_FTA OFF CACHE BOOL "TODO: Document") | ||
set(OMR_GC_OBJECT_MAP OFF CACHE BOOL "TODO: Document") | ||
set(OMR_GC_DYNAMIC_CLASS_UNLOADING OFF CACHE BOOL "TODO: Document") | ||
set(OMR_GC_MODRON_COMPACTION OFF CACHE BOOL "TODO: Document") | ||
set(OMR_GC_MODRON_CONCURRENT_MARK OFF CACHE BOOL "TODO: Document") | ||
set(OMR_GC_MODRON_SCAVENGER OFF CACHE BOOL "TODO: Document") | ||
set(OMR_GC_CONCURRENT_SCAVENGER OFF CACHE BOOL "TODO: Document") | ||
set(OMR_GC_CONCURRENT_SWEEP OFF CACHE BOOL "TODO: Document") | ||
set(OMR_GC_HYBRID_ARRAYLETS OFF CACHE BOOL "TODO: Document") | ||
set(OMR_GC_OBJECT_ALLOCATION_NOTIFY OFF CACHE BOOL "TODO: Document") | ||
set(OMR_GC_REALTIME OFF CACHE BOOL "TODO: Document") | ||
set(OMR_GC_SEGREGATED_HEAP OFF CACHE BOOL "TODO: Document") | ||
set(OMR_GC_STACCATO OFF CACHE BOOL "TODO: Document") | ||
set(OMR_GC_VLHGC OFF CACHE BOOL "TODO: Document") | ||
|
||
set(OMR_INTERP_HAS_SEMAPHORES ON CACHE BOOL "TODO: Document") | ||
set(OMR_INTERP_COMPRESSED_OBJECT_HEADER OFF CACHE BOOL "TODO: Document") | ||
set(OMR_INTERP_SMALL_MONITOR_SLOT OFF CACHE BOOL "TODO: Document") | ||
|
||
set(OMR_RAS_TDF_TRACE ON CACHE BOOL "TODO: Document") | ||
|
||
set(OMR_THR_ADAPTIVE_SPIN ON CACHE BOOL "TODO: Document") | ||
set(OMR_THR_JLM_HOLD_TIMES ON CACHE BOOL "TODO: Document") | ||
set(OMR_THR_LOCK_NURSERY ON CACHE BOOL "TODO: Document") | ||
set(OMR_THR_FORK_SUPPORT OFF CACHE BOOL "TODO: Document") | ||
set(OMR_THR_THREE_TIER_LOCKING OFF CACHE BOOL "TODO: Document") | ||
set(OMR_THR_CUSTOM_SPIN_OPTIONS OFF CACHE BOOL "TODO: Document") | ||
set(OMR_THR_SPIN_WAKE_CONTROL OFF CACHE BOOL "TODO: Document") | ||
set(OMR_THR_YIELD_ALG OFF CACHE BOOL "TODO: Document") | ||
#TODO set to disabled. Stuff fails to compile when its on | ||
set(OMR_THR_TRACING OFF CACHE BOOL "TODO: Document") | ||
|
||
#TODO this should maybe be a OMRTHREAD_LIB string variable? | ||
set(OMRTHREAD_WIN32_DEFAULT OFF) | ||
set(OMRTHREAD_UNIX_DEFAULT OFF) | ||
set(OMRTHREAD_AIX_DEFAULT OFF) | ||
set(OMRTHREAD_ZOS_DEFAULT OFF) | ||
|
||
if(OMR_HOST_OS STREQUAL "win") | ||
set(OMRTHREAD_WIN32_DEFAULT ON) | ||
elseif(OMR_HOST_OS STREQUAL "aix") | ||
set(OMRTHREAD_AIX_DEFAULT ON) | ||
elseif(OMR_HOST_OS STREQUAL "zos") | ||
set(OMRTHREAD_ZOS_DEFAULT ON) | ||
else() | ||
set(OMRTHREAD_UNIX_DEFAULT ON) | ||
endif() | ||
|
||
set(OMRTHREAD_LIB_AIX ${OMRTHREAD_AIX_DEFAULT} CACHE BOOL "TODO: Document") | ||
set(OMRTHREAD_LIB_ZOS ${OMRTHREAD_ZOS_DEFAULT} CACHE BOOL "TODO: Document") | ||
set(OMRTHREAD_LIB_WIN32 ${OMRTHREAD_WIN32_DEFAULT} CACHE BOOL "TODO: Document") | ||
set(OMRTHREAD_LIB_UNIX ${OMRTHREAD_UNIX_DEFAULT} CACHE BOOL "TODO: Document") | ||
|
||
set(OMR_PORT_CAN_RESERVE_SPECIFIC_ADDRESS ON CACHE BOOL "TODO: Document") | ||
set(OMR_PORT_NUMA_SUPPORT OFF CACHE BOOL "TODO: Document") | ||
set(OMR_PORT_ALLOCATE_TOP_DOWN OFF CACHE BOOL "TODO: Document") | ||
set(OMR_PORT_ZOS_CEEHDLRSUPPORT OFF CACHE BOOL "TODO: Document") | ||
set(OMR_PORT_ASYNC_HANDLER OFF CACHE BOOL "TODO: Document") | ||
|
||
|
||
set(OMR_NOTIFY_POLICY_CONTROL OFF CACHE BOOL "TODO: Document") | ||
|
||
set(OMR_ENV_LITTLE_ENDIAN OFF CACHE BOOL "TODO: Document") | ||
set(OMR_ENV_GCC OFF CACHE BOOL "TODO: Document") | ||
|
||
|
||
set(OMR_OPT_CUDA OFF CACHE BOOL "TODO: Document") |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
set(CMAKE_ASM-ZOS_SOURCE_FILE_EXTENSIONS s) | ||
|
||
|
||
set(CMAKE_ASM-ZOS_COMPILE_OBJECT "<CMAKE_ASM-ZOS_COMPILER> <INCLUDES> <FLAGS> <DEFINES> -o <OBJECT> <SOURCE>") | ||
|
||
# Load the generic ASMInformation file: | ||
set(ASM_DIALECT "-ZOS") | ||
include(CMakeASMInformation) | ||
set(ASM_DIALECT) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
set(ASM_DIALECT "-ZOS") | ||
set(CMAKE_ASM${ASM_DIALECT}_COMPILER_LIST xlc) | ||
include(CMakeDetermineASMCompiler) | ||
set(ASM_DIALECT) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
set(ASM_DIALECT "-ZOS") | ||
include(CMakeTestASMCompiler) | ||
set(ASM_DIALECT) |
Oops, something went wrong.