aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorbloodstalker <thabogre@gmail.com>2020-11-03 09:02:08 +0000
committerbloodstalker <thabogre@gmail.com>2020-11-03 09:02:08 +0000
commit689d8ddcd95f8e64d9696f5d683bd10a3549d3cd (patch)
treea14e0841b1c39eebead73be29a194cc7532ec819
parentsome fixes for the cmake files (diff)
downloadcgrep-689d8ddcd95f8e64d9696f5d683bd10a3549d3cd.tar.gz
cgrep-689d8ddcd95f8e64d9696f5d683bd10a3549d3cd.zip
more fixes
-rw-r--r--CMakeLists.txt24
1 files changed, 13 insertions, 11 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 3668acd..859b017 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -10,24 +10,27 @@ function(CleanMessage)
execute_process(COMMAND ${CMAKE_COMMAND} -E echo "${ARGN}")
endfunction()
-execute_process(COMMAND LLVM_CONF --cxxflags OUTPUT_VARIABLE LLVM_CXX_FLAGS)
+execute_process(COMMAND ${LLVM_CONF} --includedir OUTPUT_VARIABLE LLVM_INC_DIR)
+string(REGEX REPLACE "\n$" "" LLVM_INC_DIR "${LLVM_INC_DIR}")
+execute_process(COMMAND ${LLVM_CONF} --cxxflags OUTPUT_VARIABLE LLVM_CXX_FLAGS)
string(REGEX REPLACE "\n$" "" LLVM_CXX_FLAGS "${LLVM_CXX_FLAGS}")
-execute_process(COMMAND LLVM_CONF --src-root OUTPUT_VARIABLE LLVM_SRC_ROOT)
-string(REGEX REPLACE "\n$" "" LLVM_SRC_ROOT "${LLVM_SRC_ROOT}")
-execute_process(COMMAND LLVM_CONF --obj-root OUTPUT_VARIABLE LLVM_OBJ_ROOT)
-string(REGEX REPLACE "\n$" "" LLVM_OBJ_ROOT "${LLVM_OBJ_ROOT}")
-execute_process(COMMAND LLVM_CONF --ldflags OUTPUT_VARIABLE LLVM_LD_FLAGS)
+# execute_process(COMMAND ${LLVM_CONF} --src-root OUTPUT_VARIABLE LLVM_SRC_ROOT)
+# string(REGEX REPLACE "\n$" "" LLVM_SRC_ROOT "${LLVM_SRC_ROOT}")
+# execute_process(COMMAND ${LLVM_CONF} --obj-root OUTPUT_VARIABLE LLVM_OBJ_ROOT)
+# string(REGEX REPLACE "\n$" "" LLVM_OBJ_ROOT "${LLVM_OBJ_ROOT}")
+execute_process(COMMAND ${LLVM_CONF} --ldflags OUTPUT_VARIABLE LLVM_LD_FLAGS)
string(REGEX REPLACE "\n" "" LLVM_LD_FLAGS "${LLVM_LD_FLAGS}")
-execute_process(COMMAND LLVM_CONF --libs OUTPUT_VARIABLE LLVM_LIBS)
+execute_process(COMMAND ${LLVM_CONF} --libs OUTPUT_VARIABLE LLVM_LIBS)
string(REGEX REPLACE "\n$" "" LLVM_LIBS "${LLVM_LIBS}")
string(REGEX REPLACE "^-l" "" LLVM_LIBS "${LLVM_LIBS}")
-execute_process(COMMAND LLVM_CONF --system-libs OUTPUT_VARIABLE LLVM_SYS_LIBS)
+execute_process(COMMAND ${LLVM_CONF} --system-libs OUTPUT_VARIABLE LLVM_SYS_LIBS)
string(REGEX REPLACE "\n$" "" LLVM_SYS_LIBS "${LLVM_SYS_LIBS}")
string(REGEX REPLACE "^-l" "" LLVM_SYS_LIBS "${LLVM_SYS_LIBS}")
add_compile_options(${LLVM_CXX_FLAGS})
-add_compile_options(-I"${LLVM_SRC_ROOT}/tools/clang/include")
-add_compile_options(-I"${LLVM_OBJ_ROOT}/tools/clang/include")
+add_compile_options(-I"${LLVM_INC_DIR}")
+# add_compile_options(-I"${LLVM_SRC_ROOT}/tools/clang/include")
+# add_compile_options(-I"${LLVM_OBJ_ROOT}/tools/clang/include")
set(CMAKE_BINARY_DIR ${CMAKE_SOURCE_DIR}/bin)
set(EXECUTABLE_OUTPUT_PATH ${CMAKE_BINARY_DIR})
@@ -48,4 +51,3 @@ target_link_libraries(cgrep ${LLVM_LIBS})
include_directories("${PROJECT_SOURCE_DIR}/cfe-extra")
target_include_directories(cgrep PUBLIC "${PROJECT_BINARY_DIR}" "${PROJECT_SOURCE_DIR/cfe-extra}")
-