-
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.
- Loading branch information
1 parent
837859c
commit 8b72b9c
Showing
7 changed files
with
200 additions
and
0 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 @@ | ||
####################### | ||
# Project Information # | ||
####################### | ||
|
||
cmake_minimum_required(VERSION 2.8) | ||
project(LLVM-ECB) | ||
|
||
set(PACKAGE_VERSION "3.0.0") | ||
|
||
set(PACKAGE_NAME llvm-ecb) | ||
set(PACKAGE_STRING "${PACKAGE_NAME} ${PACKAGE_VERSION}") | ||
set(PACKAGE_BUGREPORT "chris.wailes+llvm-ecb@gmail.com") | ||
|
||
set(LLVM_ECB_VERSION_MAJOR 0) | ||
set(LLVM_ECB_VERSION_MINOR 0) | ||
|
||
set(LLVM_TARGET_VERSION \"3.0\") | ||
|
||
###################### | ||
# File Configuration # | ||
###################### | ||
|
||
configure_file(src/llvm-ecb.h.in src/llvm-ecb.h) | ||
|
||
###################### | ||
# Resource Locations # | ||
###################### | ||
|
||
include_directories (${CMAKE_BINARY_DIR}/src) | ||
include_directories(~/software-3.0.src/include/) | ||
|
||
################## | ||
# Subdirectories # | ||
################## | ||
|
||
add_subdirectory(src) |
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,24 @@ | ||
####################### | ||
# Project Information # | ||
####################### | ||
|
||
|
||
###################### | ||
# Resource Locations # | ||
###################### | ||
|
||
include_directories(${CMAKE_CURRENT_SOURCE_DIR}) | ||
|
||
################## | ||
# Subdirectories # | ||
################## | ||
|
||
add_subdirectory(support) | ||
|
||
############# | ||
# Libraries # | ||
############# | ||
|
||
add_library(llvm-ecb SHARED llvm-ecb.c) | ||
|
||
target_link_libraries(llvm-ecb support/support.a) |
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,42 @@ | ||
/* | ||
* Author: Chris Wailes <chris.wailes@gmail.com> | ||
* Project: LLVM-ECB | ||
* Date: 2012/02/13 | ||
* Description: Main header file for LLVM-ECB. | ||
*/ | ||
|
||
// Standard Includes | ||
#include <stdio.h> | ||
#include <stdlib.h> | ||
|
||
// Project Includes | ||
|
||
#include "llvm-ecb.h" | ||
|
||
// Macros | ||
|
||
#define VERSION_BUFFER_SIZE 16 | ||
|
||
// Global Variables | ||
|
||
// Functions | ||
|
||
char* LLVMECBVersion(void) { | ||
char* buffer; | ||
|
||
buffer = (char*)malloc(VERSION_BUFFER_SIZE); | ||
|
||
snprintf(buffer, VERSION_BUFFER_SIZE, "%s-%d.%d", LLVM_TARGET_VERSION, LLVM_ECB_VERSION_MAJOR, LLVM_ECB_VERSION_MINOR); | ||
|
||
return buffer; | ||
} | ||
|
||
char* LLVMTargetVersion(void) { | ||
char* buffer; | ||
|
||
buffer = (char*)malloc(VERSION_BUFFER_SIZE); | ||
|
||
snprintf(buffer, VERSION_BUFFER_SIZE, "%s", LLVM_TARGET_VERSION); | ||
|
||
return buffer; | ||
} |
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,29 @@ | ||
/* | ||
* Author: Chris Wailes <chris.wailes@gmail.com> | ||
* Project: LLVM-ECB | ||
* Date: 2012/02/13 | ||
* Description: Main header file for LLVM-ECB. | ||
*/ | ||
|
||
#ifndef LLVM_ECB_H | ||
#define LLVM_ECB_H | ||
|
||
// Standard Includes | ||
|
||
// Project Includes | ||
|
||
// Macros | ||
|
||
#define LLVM_ECB_VERSION_MAJOR @LLVM_ECB_VERSION_MAJOR@ | ||
#define LLVM_ECB_VERSION_MINOR @LLVM_ECB_VERSION_MINOR@ | ||
|
||
#define LLVM_TARGET_VERSION @LLVM_TARGET_VERSION@ | ||
|
||
// Types | ||
|
||
// Functions | ||
|
||
char* LLVMECBVersion(void); | ||
char* LLVMTargetVersion(void); | ||
|
||
#endif |
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,20 @@ | ||
####################### | ||
# Project Information # | ||
####################### | ||
|
||
|
||
###################### | ||
# Resource Locations # | ||
###################### | ||
|
||
|
||
################## | ||
# Subdirectories # | ||
################## | ||
|
||
|
||
############# | ||
# Libraries # | ||
############# | ||
|
||
add_library(support STATIC support.cpp) |
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,24 @@ | ||
/* | ||
* Author: Chris Wailes <chris.wailes@gmail.com> | ||
* Project: LLVM-ECB | ||
* Date: 2012/02/13 | ||
* Description: Extended C bindings for the LLVM::Support namespace. | ||
*/ | ||
|
||
// Standard Includes | ||
|
||
#include <llvm/Support/DynamicLibrary.h> | ||
|
||
// Project Includes | ||
|
||
// Macros | ||
|
||
// Global Variables | ||
|
||
// Functions | ||
|
||
extern "C" { | ||
int LLVMLoadLibraryPermanently(const char* filename) { | ||
return llvm::sys::DynamicLibrary::LoadLibraryPermanently(filename); | ||
} | ||
} |
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,25 @@ | ||
/* | ||
* Author: Chris Wailes <chris.wailes@gmail.com> | ||
* Project: LLVM-ECB | ||
* Date: 2012/02/13 | ||
* Description: Header file for C bindings for the LLVM::Support namespace. | ||
*/ | ||
|
||
#ifndef SUPPORT_H | ||
#define SUPPORT_H | ||
|
||
// Standard Includes | ||
|
||
// Project Includes | ||
|
||
// Macros | ||
|
||
// Types | ||
|
||
// Functions | ||
|
||
extern "C" { | ||
int LLVMLoadLibraryPermanently(const char* filename); | ||
} | ||
|
||
#endif |