diff --git a/CMakeLists.txt b/CMakeLists.txt index a038353..20e27d7 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -1,22 +1,3 @@ cmake_minimum_required(VERSION 2.8.12) -project(BlitzLLVM) -# Version -INCLUDE("CMakeVersion.txt") - -SET(DEPENDENCY_LLVM "${PROJECT_SOURCE_DIR}/thirdparty/llvm" CACHE PATH "Path to LLVM source code") - -# Source Files -SET(BlitzLLVM_SOURCE - "source/main.cpp" -) - -INCLUDE_DIRECTORIES( - "${CMAKE_SOURCE_DIR}" - "${PROJECT_SOURCE_DIR}" - "${PROJECT_SOURCE_DIR}/source" - "${DEPENDENCY_LLVM}/include" - "${PROJECT_BINARY_DIR}" -) - -add_executable(BlitzLLVM ${BlitzLLVM_SOURCE}) +ADD_SUBDIRECTORY("projects/code_compiler") \ No newline at end of file diff --git a/projects/code_compiler/CMakeLists.txt b/projects/code_compiler/CMakeLists.txt new file mode 100644 index 0000000..fa17ec1 --- /dev/null +++ b/projects/code_compiler/CMakeLists.txt @@ -0,0 +1,44 @@ +cmake_minimum_required(VERSION 2.8.12) +project(CodeCompiler) + +# Configuration +SET(THIRDPARTY_LLVM "${CMAKE_SOURCE_DIR}/thirdparty/llvm" CACHE PATH "Path to LLVM source code") + +## Dependencies +# LLVM +SET(LLVM_BUILD_TOOLS OFF) +SET(LLVM_BUILD_EXAMPLES OFF) +SET(LLVM_BUILD_TESTS OFF) +SET(LLVM_INCLUDE_TESTS OFF) +SET(BUILD_SHARED_LIBS OFF) +SET(LLVM_BUILD_LLVM_DYLIB OFF) +ADD_SUBDIRECTORY("${DEPENDENCY_LLVM}") + +## Version +INCLUDE("CMakeVersion.txt") + +## Compiling +# Source Files +SET(SOURCE + "source/main.cpp" +) +SET(DATA + "templates/version.h" +) + +# Include Directories +INCLUDE_DIRECTORIES( + "${CMAKE_SOURCE_DIR}" + "${PROJECT_SOURCE_DIR}" + "${PROJECT_SOURCE_DIR}/source" + "${THIRDPARTY_LLVM}/include" + "${PROJECT_BINARY_DIR}" +) + +# Building +add_executable(${PROJECT_NAME} ${SOURCE}) + +# Linking +TARGET_LINK_LIBRARIES(${PROJECT_NAME} + LLVM +) diff --git a/CMakeVersion.txt b/projects/code_compiler/CMakeVersion.txt similarity index 100% rename from CMakeVersion.txt rename to projects/code_compiler/CMakeVersion.txt diff --git a/projects/code_compiler/source/main.cpp b/projects/code_compiler/source/main.cpp new file mode 100644 index 0000000..6bcd22a --- /dev/null +++ b/projects/code_compiler/source/main.cpp @@ -0,0 +1,4 @@ + +int main(int argc, char** argv) { + +} \ No newline at end of file diff --git a/templates/version.h b/projects/code_compiler/templates/version.h similarity index 100% rename from templates/version.h rename to projects/code_compiler/templates/version.h diff --git a/source/main.cpp b/source/main.cpp deleted file mode 100644 index e69de29..0000000