diff --git a/CMakeLists.txt b/CMakeLists.txt index d6a3e282c3..a1dd49ac7b 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -13,7 +13,8 @@ set(ZIG_VERSION "${ZIG_VERSION_MAJOR}.${ZIG_VERSION_MINOR}.${ZIG_VERSION_PATCH}" message("Configuring zig version ${ZIG_VERSION}") find_package(llvm) -include_directories(${LLVM_INCLUDE_DIR}) +include_directories(${LLVM_INCLUDE_DIRS}) +link_directories(${LLVM_LIBDIRS}) include_directories( ${CMAKE_SOURCE_DIR} diff --git a/README.md b/README.md index 20cdb47809..8ff5f015bc 100644 --- a/README.md +++ b/README.md @@ -31,8 +31,8 @@ readable, safe, optimal, and concise code to solve any computing problem. ## Roadmap - * C style comments. * Unit tests. + * C style comments. * Simple .so library * Multiple files * figure out integers diff --git a/cmake/Findllvm.cmake b/cmake/Findllvm.cmake index abe5c3b21f..acdb552dc9 100644 --- a/cmake/Findllvm.cmake +++ b/cmake/Findllvm.cmake @@ -3,19 +3,35 @@ # See http://opensource.org/licenses/MIT # LLVM_FOUND -# LLVM_INCLUDE_DIR +# LLVM_INCLUDE_DIRS # LLVM_LIBRARIES +# LLVM_LIBDIRS -find_path(LLVM_INCLUDE_DIR NAMES llvm-c/Core.h) +find_path(LLVM_C_INCLUDE_DIR NAMES llvm-c/Core.h PATHS /usr/include/llvm-c-3.7/) +find_path(LLVM_INCLUDE_DIR NAMES llvm/IR/IRBuilder.h PATHS /usr/include/llvm-3.7/) -find_program(LLVM_CONFIG_EXE llvm-config) +find_program(LLVM_CONFIG_EXE NAMES llvm-config llvm-config-3.7) execute_process( COMMAND ${LLVM_CONFIG_EXE} --libs OUTPUT_VARIABLE LLVM_LIBRARIES OUTPUT_STRIP_TRAILING_WHITESPACE) -include(FindPackageHandleStandardArgs) -find_package_handle_standard_args(LLVM DEFAULT_MSG LLVM_LIBRARIES LLVM_INCLUDE_DIR) +execute_process( + COMMAND ${LLVM_CONFIG_EXE} --system-libs + OUTPUT_VARIABLE LLVM_SYSTEM_LIBS + OUTPUT_STRIP_TRAILING_WHITESPACE) -mark_as_advanced(LLVM_INCLUDE_DIR LLVM_LIBRARIES) +execute_process( + COMMAND ${LLVM_CONFIG_EXE} --libdir + OUTPUT_VARIABLE LLVM_LIBDIRS + OUTPUT_STRIP_TRAILING_WHITESPACE) + +set(LLVM_INCLUDE_DIRS "${LLVM_C_INCLUDE_DIR} ${LLVM_INCLUDE_DIR}") +set(LLVM_LIBRARIES "${LLVM_LIBRARIES} ${LLVM_SYSTEM_LIBS}") + + +include(FindPackageHandleStandardArgs) +find_package_handle_standard_args(LLVM DEFAULT_MSG LLVM_LIBRARIES LLVM_INCLUDE_DIRS) + +mark_as_advanced(LLVM_INCLUDE_DIRS LLVM_LIBRARIES LLVM_LIBDIRS)