1
0
Fork 0
mirror of https://github.com/LadybirdBrowser/ladybird.git synced 2025-06-10 01:51:03 +09:00
ladybird/Base/res/devel/templates/cpp-library.postcreate
Andrew Kaster 77e890b15e Meta+Documentation+Ports: Move from C++20 to C++23
Now that oss-fuzz is on a clang commit > the 17.x release candidates,
we can start looking at some shiny new features to enable.
2024-05-06 11:46:28 -06:00

28 lines
518 B
Text

#!/bin/Shell
# $1: Project name, filesystem safe
# $2: Project full path
# $3: Project name, namespace safe
# FIXME: Use a single sed command once we support that.
sed -i "s/\\\$LibName/$3/g" $2/Class1.h
sed -i "s/\\\$LibName/$3/g" $2/Class1.cpp
# Generate Makefile
echo > $2/Makefile <<-EOF
LIBRARY = $1.so
OBJS = Class1.o
CXXFLAGS = -g -std=c++23
all: \$(LIBRARY)
\$(LIBRARY): \$(OBJS)
\$(CXX) -shared -o \$@ \$(OBJS)
%.o: %.cpp
\$(CXX) \$(CXXFLAGS) -fPIC -o \$@ -c \$<
clean:
rm \$(OBJS) \$(LIBRARY)
EOF