Skip to content

Commit c315f18

Browse files
committed
Simplify the build to not use llvm-config
1 parent dfd5933 commit c315f18

File tree

1 file changed

+5
-14
lines changed

1 file changed

+5
-14
lines changed

CMakeLists.txt

Lines changed: 5 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -3,22 +3,13 @@ project(scala-native-bindgen)
33

44
# Locate $LLVM_PATH/lib/cmake/clang/ClangConfig.cmake
55
find_package(Clang REQUIRED CONFIG)
6+
message(STATUS "Found LLVM ${LLVM_PACKAGE_VERSION}")
7+
message(STATUS "Using LLVMConfig.cmake in: ${LLVM_DIR}")
68

7-
# Read and set CXXFLAGS and LDFLAGS
8-
execute_process(COMMAND llvm-config --cxxflags
9-
OUTPUT_VARIABLE LLVM_CXX_FLAGS
10-
OUTPUT_STRIP_TRAILING_WHITESPACE
11-
)
12-
13-
execute_process(COMMAND llvm-config --ldflags
14-
OUTPUT_VARIABLE LLVM_LINKER_FLAGS
15-
OUTPUT_STRIP_TRAILING_WHITESPACE
16-
)
17-
18-
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${LLVM_CXX_FLAGS}")
19-
set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} ${LLVM_LINKER_FLAGS}")
9+
include_directories(${LLVM_INCLUDE_DIRS})
10+
add_definitions(${LLVM_DEFINITIONS})
2011

21-
add_compile_options(-fexceptions)
12+
add_compile_options(-fexceptions -std=c++11)
2213

2314
add_executable(scalaBindgen
2415
Main.cpp

0 commit comments

Comments
 (0)