-
Notifications
You must be signed in to change notification settings - Fork 14.8k
[ORC-RT] Initial check-in for a new, top-level ORC runtime project. #113499
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Changes from 3 commits
fb7698d
f801afb
6011619
81dc0e4
7106b9d
db27097
b0eb599
400d2fc
4a03938
e872a8c
bb5fb11
267fd01
327a64a
0a25634
b348769
7a3a185
b804b1f
c57f7ce
e31c343
e512c16
91e73b1
ea1955d
cab25e9
3d624db
124d7e4
6957220
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
# CMake build for ORC-RT. | ||
|
||
#=============================================================================== | ||
# Setup Project | ||
#=============================================================================== | ||
|
||
cmake_minimum_required(VERSION 3.20.0) | ||
|
||
set(LLVM_COMMON_CMAKE_UTILS ${CMAKE_CURRENT_SOURCE_DIR}/../cmake) | ||
include(${LLVM_COMMON_CMAKE_UTILS}/Modules/CMakePolicy.cmake | ||
NO_POLICY_SCOPE) | ||
|
||
project(LibOrcRT LANGUAGES C CXX ASM) | ||
|
||
include(GNUInstallDirs) | ||
|
||
#=============================================================================== | ||
# Setup CMake Options | ||
#=============================================================================== | ||
|
||
set(CMAKE_CXX_STANDARD 17 CACHE STRING "C++ standard to conform to") | ||
set(CMAKE_CXX_STANDARD_REQUIRED YES) | ||
set(CMAKE_CXX_EXTENSIONS NO) | ||
set(CMAKE_FOLDER "orc-rt") | ||
|
||
#=============================================================================== | ||
# Setup Source Code | ||
#=============================================================================== | ||
|
||
add_subdirectory(include) | ||
add_subdirectory(lib) | ||
add_subdirectory(tools) |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
set(files | ||
orc-rt-c/orc-rt.h | ||
) | ||
|
||
add_library(orc-rt-headers INTERFACE) | ||
lhames marked this conversation as resolved.
Show resolved
Hide resolved
|
||
target_include_directories(orc-rt-headers INTERFACE | ||
$<BUILD_INTERFACE:${PROJECT_SOURCE_DIR}/include> | ||
$<INSTALL_INTERFACE:include> | ||
) | ||
target_sources(orc-rt-headers | ||
INTERFACE FILE_SET HEADERS | ||
BASE_DIRS ${CMAKE_CURRENT_SOURCE_DIR} | ||
FILES ${files} | ||
) | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. File Sets were introduced in CMake 3.23 but LLVM currently requires 3.20 as the minimum version. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Thanks for spotting that! I've switched to |
||
install(TARGETS orc-rt-headers | ||
FILE_SET HEADERS DESTINATION include) |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
/*===- orc-rt-c/orc-rt.h - Placeholder header for orc-rt ----------*- C -*-===*\ | ||
|* *| | ||
|* Part of the LLVM Project, under the Apache License v2.0 with LLVM *| | ||
|* Exceptions. *| | ||
|* See https://llvm.org/LICENSE.txt for license information. *| | ||
|* SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception *| | ||
|* *| | ||
|*===----------------------------------------------------------------------===*| | ||
|* *| | ||
|* Placeholder header for initial orc-rt checkin *| | ||
|* *| | ||
\*===----------------------------------------------------------------------===*/ | ||
lhames marked this conversation as resolved.
Show resolved
Hide resolved
|
||
|
||
#ifndef ORC_RT_C_ORC_RT_H | ||
#define ORC_RT_C_ORC_RT_H | ||
|
||
#ifdef __cplusplus | ||
extern "C" { | ||
#endif | ||
|
||
void orc_rt(void); | ||
|
||
#ifdef __cplusplus | ||
} /* extern "C" */ | ||
#endif | ||
|
||
#endif /* ORC_RT_C_ORC_RT_H */ |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
add_subdirectory(executor) |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
set(files | ||
orc-rt-executor.cpp | ||
) | ||
|
||
add_library(orc-rt-executor STATIC ${files}) | ||
target_link_libraries(orc-rt-executor | ||
PUBLIC orc-rt-headers | ||
) | ||
install(TARGETS orc-rt-executor | ||
ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR} | ||
COMPONENT OrcRT_Development | ||
PUBLIC_HEADER DESTINATION include COMPONENT OrcRT_Development | ||
) |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
#include <stdio.h> | ||
lhames marked this conversation as resolved.
Show resolved
Hide resolved
|
||
|
||
extern "C" void orc_rt(void) { printf("hello, world!\n"); } |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
add_subdirectory(orc-executor) |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
add_executable(orc-executor orc-executor.cpp) | ||
target_link_libraries(orc-executor PRIVATE orc-rt-executor) | ||
target_include_directories(orc-executor PRIVATE ../../include) | ||
lhames marked this conversation as resolved.
Show resolved
Hide resolved
|
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
#include "orc-rt-c/orc-rt.h" | ||
lhames marked this conversation as resolved.
Show resolved
Hide resolved
|
||
|
||
int main(int argc, char *argv[]) { | ||
orc_rt(); | ||
return 0; | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There should also be a custom command that copies every header in
ORC_RT_HEADERS
to output directory.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hmm…what's the reason here?