summaryrefslogtreecommitdiff
path: root/build.ninja
diff options
context:
space:
mode:
Diffstat (limited to 'build.ninja')
-rw-r--r--build.ninja35
1 files changed, 35 insertions, 0 deletions
diff --git a/build.ninja b/build.ninja
new file mode 100644
index 0000000..7824f0b
--- /dev/null
+++ b/build.ninja
@@ -0,0 +1,35 @@
+# Copyright 2022 Benjamin Barenblat
+#
+# Licensed under the Apache License, Version 2.0 (the "License"); you may not
+# use this file except in compliance with the License. You may obtain a copy of
+# the License at
+#
+# https://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
+# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
+# License for the specific language governing permissions and limitations under
+# the License.
+
+ninja_required_version = 1.3
+
+rule cxx
+ command = g++ -MD -MT $out -MF $out.d -pipe -std=c++20 -fno-rtti -Wall $
+ -Wextra -Wno-sign-compare -fdiagnostics-show-template-tree -O3 -flto $
+ -fstack-protector-strong -Wformat -Werror=format-security $
+ -D_FORTIFY_SOURCE=2 -DNDEBUG -D_REENTRANT -ffunction-sections $
+ -fdata-sections -c $in -o $out
+ description = Compiling $out
+ depfile = $out.d
+ deps = gcc
+
+rule link
+ command = g++ -fuse-ld=gold -flto -Wl,-O2 -Wl,--gc-sections -Wl,--as-needed $
+ -Wl,-z,relro -Wl,-z,now -o $out $in $libs && strip $out
+ description = Linking $out
+
+build pavmon.o: cxx pavmon.cc
+build pulse.o: cxx pulse.cc
+build pavmon: link pavmon.o pulse.o
+ libs = -lpulse