File tree Expand file tree Collapse file tree 1 file changed +25
-2
lines changed Expand file tree Collapse file tree 1 file changed +25
-2
lines changed Original file line number Diff line number Diff line change 1
1
#! /bin/sh
2
2
3
3
# This script will compile all files with .cpp extension in the parent directory
4
- # Clang version 12 (or newer) C++ modules version
4
+ # Clang version 16 (or newer) C++ modules version
5
+
6
+ if [ -z " $CLANG_PREFIX " ] ; then
7
+ CLANG_PREFIX=" /usr"
8
+ fi
9
+
10
+ if [ -z " $CLANG_PCM " ] ; then
11
+ CLANG_PCM=" ./std.pcm"
12
+ fi
13
+
14
+ CLANG=" $CLANG_PREFIX /bin/clang++"
15
+
16
+ if [ ! -f " $CLANG_PCM " ] ; then
17
+ echo " Compiling library module..."
18
+ if [ ! -f " $CLANG_PREFIX /share/libc++/v1/std.cppm" ] ; then
19
+ echo " Error: Could not find file $CLANG_PREFIX /share/libc++/v1/std.cppm"
20
+ echo " Please set environment variable CLANG_PREFIX and re-run script"
21
+ exit 1
22
+ fi
23
+ LD_LIBRARY_PATH=" $CLANG_PREFIX /lib" :" $CLANG_PREFIX /lib/x86_64-unknown-linux-gnu" \
24
+ " $CLANG " -std=c++23 -stdlib=libc++ -Wno-reserved-identifier -Wno-reserved-module-identifier \
25
+ --precompile -o " $CLANG_PCM " " $CLANG_PREFIX /share/libc++/v1/std.cppm"
26
+ fi
5
27
6
28
failures=0
7
29
for PROGRAM in ../* .cpp ; do
8
30
BASE=" $( basename $PROGRAM ) "
9
31
echo " $BASE ..."
10
32
failed=" "
11
- clang++ -fmodules -std=c++20 -stdlib=libc++ -o ${BASE% .cpp} $PROGRAM > /dev/null 2>&1 || failed=" y"
33
+ LD_LIBRARY_PATH=" $CLANG_PREFIX /lib" :" $CLANG_PREFIX /lib/x86_64-unknown-linux-gnu" \
34
+ " $CLANG " -fmodule-file=std=" $CLANG_PCM " -std=c++23 -stdlib=libc++ -o ${BASE% .cpp} $PROGRAM || failed=" y"
12
35
if [ -n " $failed " ] ; then
13
36
echo " Failed to compile $BASE "
14
37
failures=$(( failures+ 1 ))
You can’t perform that action at this time.
0 commit comments