File tree Expand file tree Collapse file tree 4 files changed +43
-21
lines changed Expand file tree Collapse file tree 4 files changed +43
-21
lines changed Original file line number Diff line number Diff line change
1
+ target
Original file line number Diff line number Diff line change
1
+ language : cpp
2
+ sudo : false
3
+ compiler : clang
4
+
5
+ script :
6
+ - mkdir -p target
7
+ - cd target
8
+ - cmake ..
9
+ - make
10
+ - ./scalaBindgen /usr/include/ctype.h -name ctype
Original file line number Diff line number Diff line change 1
- set (LLVM_LINK_COMPONENTS support )
1
+ cmake_minimum_required (VERSION 3.9 )
2
+ project (scala-native-bindgen )
3
+
4
+ # Locate $LLVM_PATH/lib/cmake/clang/ClangConfig.cmake
5
+ find_package (Clang REQUIRED CONFIG )
6
+
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} " )
2
20
3
21
add_compile_options (-fexceptions )
4
22
5
- add_clang_executable (scalaBindgen
23
+ add_executable (scalaBindgen
6
24
Main.cpp
7
25
ScalaFrontend.h
8
26
TreeVisitor.h
@@ -21,16 +39,5 @@ add_clang_executable(scalaBindgen
21
39
target_link_libraries (scalaBindgen
22
40
PRIVATE
23
41
clangFrontend
24
- clangSerialization
25
- clangDriver
26
42
clangTooling
27
- clangParse
28
- clangSema
29
-
30
- clangAnalysis
31
-
32
- clangEdit
33
- clangAST
34
- clangLex
35
- clangBasic
36
43
)
Original file line number Diff line number Diff line change @@ -14,11 +14,15 @@ Running the previous command wild also yield warnings along with the translation
14
14
15
15
## Building
16
16
17
- Building this tool require building LLVM and Clang. This can take hours. Please consider using pre-built binaries.
18
-
19
- * Follow the [ building instructions] ( http://clang.llvm.org/docs/LibASTMatchersTutorial.html#step-0-obtaining-clang ) for Clang (Only step 0)
20
- * Go to ` llvm/tools/clang/tools/extra `
21
- * Clone this repository ` git clone https://github.com/mrRosset/scala-native-bindgen scala-bindgen `
22
- * Add ` add_subdirectory(scala-bindgen) ` to the CMakeLists.txt in the extra folder
23
- * Re-run the llvm/clang compilation
24
-
17
+ Building this tool requires LLVM and Clang. Ensure that ` llvm-config ` is in your path.
18
+
19
+ ``` sh
20
+ # Validate LLVM installation
21
+ llvm-config --version --cmakedir --cxxflags --ldflags
22
+
23
+ mkdir -p target
24
+ cd target
25
+ cmake ..
26
+ make
27
+ ./scalaBindgen /usr/include/ctype.h -name ctype
28
+ ```
You can’t perform that action at this time.
0 commit comments