Skip to content

Commit fb69d83

Browse files
author
Your Name
committed
Enable DSMIL by default and add wrapper binaries
1 parent fb441ac commit fb69d83

File tree

5 files changed

+39
-1
lines changed

5 files changed

+39
-1
lines changed

dsmil/CMakeLists.txt

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,3 +13,22 @@ install(
1313
FILES_MATCHING
1414
PATTERN "*.h"
1515
)
16+
17+
set(DSMIL_WRAPPER_TEMPLATES
18+
tools/dsmil-clang.in
19+
tools/dsmil-clang++.in
20+
tools/dsmil-opt.in
21+
)
22+
23+
set(DSMIL_WRAPPER_OUTPUTS "")
24+
foreach(wrapper ${DSMIL_WRAPPER_TEMPLATES})
25+
get_filename_component(wrapper_name ${wrapper} NAME_WE)
26+
set(configured_wrapper ${CMAKE_CURRENT_BINARY_DIR}/${wrapper_name})
27+
configure_file(${wrapper} ${configured_wrapper} @ONLY)
28+
list(APPEND DSMIL_WRAPPER_OUTPUTS ${configured_wrapper})
29+
endforeach()
30+
31+
install(
32+
PROGRAMS ${DSMIL_WRAPPER_OUTPUTS}
33+
DESTINATION ${CMAKE_INSTALL_BINDIR}
34+
)

dsmil/tools/dsmil-clang++.in

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
#!/usr/bin/env bash
2+
# Wrapper to invoke clang++ with DSMIL plugin and runtime paths preloaded.
3+
exec "@CMAKE_INSTALL_FULL_BINDIR@/clang++" \
4+
-fpass-plugin="@CMAKE_INSTALL_FULL_LIBDIR@/DsmilPasses.so" \
5+
-I"@CMAKE_INSTALL_FULL_INCLUDEDIR@/dsmil" \
6+
-L"@CMAKE_INSTALL_FULL_LIBDIR@" -ldsmilrt \
7+
"$@"

dsmil/tools/dsmil-clang.in

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
#!/usr/bin/env bash
2+
# Wrapper to invoke clang with DSMIL plugin and runtime paths preloaded.
3+
exec "@CMAKE_INSTALL_FULL_BINDIR@/clang" \
4+
-fpass-plugin="@CMAKE_INSTALL_FULL_LIBDIR@/DsmilPasses.so" \
5+
-I"@CMAKE_INSTALL_FULL_INCLUDEDIR@/dsmil" \
6+
-L"@CMAKE_INSTALL_FULL_LIBDIR@" -ldsmilrt \
7+
"$@"

dsmil/tools/dsmil-opt.in

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
#!/usr/bin/env bash
2+
# Wrapper to invoke opt with DSMIL plugin preloaded.
3+
exec "@CMAKE_INSTALL_FULL_BINDIR@/opt" \
4+
-load-pass-plugin "@CMAKE_INSTALL_FULL_LIBDIR@/DsmilPasses.so" \
5+
"$@"

llvm/CMakeLists.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -862,7 +862,7 @@ option(LLVM_INCLUDE_EXAMPLES "Generate build targets for the LLVM examples" ON)
862862
option(LLVM_BUILD_TESTS
863863
"Build LLVM unit tests. If OFF, just generate build targets." OFF)
864864
option(LLVM_INCLUDE_TESTS "Generate build targets for the LLVM unit tests." ON)
865-
option(LLVM_ENABLE_DSMIL "Build DSMIL pass plugin and runtime from ../dsmil" OFF)
865+
option(LLVM_ENABLE_DSMIL "Build DSMIL pass plugin and runtime from ../dsmil" ON)
866866

867867
option(LLVM_INSTALL_GTEST
868868
"Install the llvm gtest library. This should be on if you want to do

0 commit comments

Comments
 (0)