diff options
Diffstat (limited to 'buildconf')
-rw-r--r-- | buildconf/asan.ninja | 22 | ||||
-rw-r--r-- | buildconf/common.ninja | 447 | ||||
-rw-r--r-- | buildconf/dbg.ninja | 20 | ||||
-rw-r--r-- | buildconf/fastbuild.ninja | 17 | ||||
-rw-r--r-- | buildconf/release.ninja | 29 |
5 files changed, 535 insertions, 0 deletions
diff --git a/buildconf/asan.ninja b/buildconf/asan.ninja new file mode 100644 index 0000000..51b26c0 --- /dev/null +++ b/buildconf/asan.ninja @@ -0,0 +1,22 @@ +# Copyright 2021 Google LLC +# +# 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. + +third_party_cflags = -fsanitize=address + +cxxflags = -fsanitize=address -Werror +third_party_cxxflags = -fsanitize=address + +ldflags = -fsanitize=address + +subninja buildconf/common.ninja diff --git a/buildconf/common.ninja b/buildconf/common.ninja new file mode 100644 index 0000000..0ca45a9 --- /dev/null +++ b/buildconf/common.ninja @@ -0,0 +1,447 @@ +# Copyright 2021 Google LLC +# Copyright 2021, 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 + +absl = third_party/abseil/absl + +common_cflags = -I. -isystem third_party/abseil $ + -isystem third_party/date/include -isystem third_party/glew/include $ + -isystem /usr/include/eigen3 -DEIGEN_MPL2_ONLY -DUSE_OS_TZDB $ + -DUSE_SHELL_API=0 -DGLEW_STATIC -pipe -pthread + +third_party_cflags = $common_cflags $third_party_cflags + +cxxflags = $common_cflags -std=c++20 -Wall -Wextra -Wno-sign-compare $ + -fdiagnostics-show-template-tree $cxxflags +third_party_cxxflags = $common_cflags -std=c++20 $ + -fdiagnostics-show-template-tree $third_party_cxxflags + +# LOCAL ------------------------------------------------------------------------ +cc = gcc +cxx = g++ +ldflags = -fuse-ld=lld $ldflags +# ldflags = -fuse-ld=gold $ldflags +# LOCAL ------------------------------------------------------------------------ +# cc = clang +# cxx = clang++ +# ldflags = -fuse-ld=lld $ldflags +# LOCAL ------------------------------------------------------------------------ + +rule ar + command = rm -f $out && ar -rcs $out $in + description = Generating $out + +rule bin2obj + command = ld -r -b binary -o $out $in && objcopy --rename-section $ + .data=.rodata,alloc,load,readonly,data,contents $out + description = Generating $out + +rule cc + command = $cc -MD -MT $out -MF $out.d -c $in -o $out $cflags + description = Compiling $out + depfile = $out.d + deps = gcc + +rule cxx + command = $cxx -MD -MT $out -MF $out.d -c $in -o $out $cxxflags + description = Compiling $out + depfile = $out.d + deps = gcc + +rule generate_resources_header + command = gen/resources_header $resources | clang-format --style=Google >$out + description = Generating $out + +rule link + command = $cxx $ldflags -o $out $in $libs -pthread + description = Linking $out + +build res/clouds.o: bin2obj res/clouds.webp +build res/earth.o: bin2obj res/earth.webp +build res/fragment.o: bin2obj res/fragment.glsl +build res/vertex.o: bin2obj res/vertex.glsl + +build res/res.h: generate_resources_header res | gen/resources_header + resources = res/clouds.webp res/earth.webp res/fragment.glsl res/vertex.glsl + +build src/astro.o: cxx src/astro.cc +build src/egl.o: cxx src/egl.cc +build src/glplanet.o: cxx src/glplanet.cc | res/res.h +build src/gl/buffer.o: cxx src/gl/buffer.cc +build src/gl/draw.o: cxx src/gl/draw.cc +build src/gl/error.o: cxx src/gl/error.cc +build src/gl/init.o: cxx src/gl/init.cc +build src/gl/shader.o: cxx src/gl/shader.cc +build src/gl/texture.o: cxx src/gl/texture.cc +build src/gl/vertex_array.o: cxx src/gl/vertex_array.cc +build src/main.o: cxx src/main.cc +build src/mesh.o: cxx src/mesh.cc +build src/scene.o: cxx src/scene.cc +build src/webp.o: cxx src/webp.cc +build src/x/connection.o: cxx src/x/connection.cc +build src/x/error.o: cxx src/x/error.cc +build src/x/event.o: cxx src/x/event.cc +build src/x/init.o: cxx src/x/init.cc +build src/x/rpc.o: cxx src/x/rpc.cc + +build src/astro_test.o: cxx src/astro_test.cc +build src/astro_test: link src/astro.o src/astro_test.o $ + third_party/date/src/tz.a + libs = -lgmock_main -lgmock -lgtest -lm + +build src/astro_benchmark.o: cxx src/astro_benchmark.cc +build src/astro_benchmark: link src/astro.o src/astro_benchmark.o $ + third_party/benchmark/build/src/libbenchmark.a $ + third_party/benchmark/build/src/libbenchmark_main.a $ + third_party/date/src/tz.a + libs = -lm + +build src/mesh_test.o: cxx src/mesh_test.cc +build src/mesh_test: link src/mesh.o src/mesh_test.o $absl/strings/strings.a $ + $absl/strings/internal.a $absl/base/base.a $absl/base/spinlock_wait.a $ + $absl/numeric/int128.a $absl/base/throw_delegate.a $ + $absl/base/raw_logging_internal.a $absl/base/log_severity.a + libs = -lgmock_main -lgmock -lgtest -lrt -lm + +build glplanet: link res/clouds.o res/earth.o res/fragment.o res/vertex.o $ + src/astro.o src/gl/buffer.o src/gl/draw.o src/gl/error.o src/gl/init.o $ + src/gl/shader.o src/gl/texture.o src/gl/vertex_array.o src/x/connection.o $ + src/x/error.o src/x/event.o src/x/init.o src/x/rpc.o src/egl.o $ + src/glplanet.o src/main.o src/mesh.o src/scene.o src/webp.o $ + $absl/strings/cord.a $absl/strings/cordz_info.a $ + $absl/strings/cord_internal.a $absl/strings/cordz_functions.a $ + $absl/profiling/exponential_biased.a $absl/strings/cordz_handle.a $ + $absl/synchronization/synchronization.a $ + $absl/synchronization/graphcycles_internal.a $absl/debugging/stacktrace.a $ + $absl/debugging/symbolize.a $absl/debugging/debugging_internal.a $ + $absl/debugging/demangle_internal.a $absl/base/malloc_internal.a $ + $absl/time/time.a $absl/time/civil_time.a $absl/strings/strings.a $ + $absl/strings/internal.a $absl/base/base.a $absl/base/spinlock_wait.a $ + $absl/numeric/int128.a $absl/time/time_zone.a $ + $absl/types/bad_optional_access.a $absl/base/throw_delegate.a $ + $absl/types/bad_variant_access.a $absl/base/raw_logging_internal.a $ + $absl/base/log_severity.a third_party/date/src/tz.a $ + third_party/glew/src/glew.a + libs = -lEGL -lGLU -lGL -lX11-xcb -lX11 -lxcb-util -lxcb -lwebp -lm -lrt + +# //absl/base +build $absl/base/base.a: ar $absl/base/internal/cycleclock.o $ + $absl/base/internal/spinlock.o $absl/base/internal/sysinfo.o $ + $absl/base/internal/thread_identity.o $ + $absl/base/internal/unscaledcycleclock.o +build $absl/base/internal/cycleclock.o: cxx $absl/base/internal/cycleclock.cc + cxxflags = $third_party_cxxflags +build $absl/base/internal/spinlock.o: cxx $absl/base/internal/spinlock.cc + cxxflags = $third_party_cxxflags +build $absl/base/internal/sysinfo.o: cxx $absl/base/internal/sysinfo.cc + cxxflags = $third_party_cxxflags +build $absl/base/internal/thread_identity.o: cxx $ + $absl/base/internal/thread_identity.cc + cxxflags = $third_party_cxxflags +build $absl/base/internal/unscaledcycleclock.o: cxx $ + $absl/base/internal/unscaledcycleclock.cc + cxxflags = $third_party_cxxflags + +# //absl/base:log_severity +build $absl/base/log_severity.a: ar $absl/base/log_severity.o +build $absl/base/log_severity.o: cxx $absl/base/log_severity.cc + cxxflags = $third_party_cxxflags + +# //absl/base:malloc_internal +build $absl/base/malloc_internal.a: ar $absl/base/internal/low_level_alloc.o +build $absl/base/internal/low_level_alloc.o: cxx $ + $absl/base/internal/low_level_alloc.cc + cxxflags = $third_party_cxxflags + +# //absl/base:raw_logging_internal +build $absl/base/raw_logging_internal.a: ar $absl/base/internal/raw_logging.o +build $absl/base/internal/raw_logging.o: cxx $absl/base/internal/raw_logging.cc + cxxflags = $third_party_cxxflags + +# //absl/base:spinlock_wait +build $absl/base/spinlock_wait.a: ar $absl/base/internal/spinlock_wait.o +build $absl/base/internal/spinlock_wait.o: cxx $ + $absl/base/internal/spinlock_wait.cc | $ + $absl/base/internal/spinlock_linux.inc + cxxflags = $third_party_cxxflags + +# //absl/base:throw_delegate +build $absl/base/throw_delegate.a: ar $absl/base/internal/throw_delegate.o +build $absl/base/internal/throw_delegate.o: cxx $ + $absl/base/internal/throw_delegate.cc + cxxflags = $third_party_cxxflags + +# //absl/debugging:debugging_internal +build $absl/debugging/debugging_internal.a: ar $ + $absl/debugging/internal/address_is_readable.o $ + $absl/debugging/internal/elf_mem_image.o $ + $absl/debugging/internal/vdso_support.o +build $absl/debugging/internal/address_is_readable.o: cxx $ + $absl/debugging/internal/address_is_readable.cc + cxxflags = $third_party_cxxflags +build $absl/debugging/internal/elf_mem_image.o: cxx $ + $absl/debugging/internal/elf_mem_image.cc + cxxflags = $third_party_cxxflags +build $absl/debugging/internal/vdso_support.o: cxx $ + $absl/debugging/internal/vdso_support.cc + cxxflags = $third_party_cxxflags + +# //absl:debugging:demangle_internal +build $absl/debugging/demangle_internal.a: ar $ + $absl/debugging/internal/demangle.o +build $absl/debugging/internal/demangle.o: cxx $ + $absl/debugging/internal/demangle.cc + cxxflags = $third_party_cxxflags + +# //absl/debugging:stacktrace +build $absl/debugging/stacktrace.a: ar $absl/debugging/stacktrace.o +build $absl/debugging/stacktrace.o: cxx $absl/debugging/stacktrace.cc | $ + $absl/debugging/internal/stacktrace_config.h $ + $absl/debugging/internal/stacktrace_x86-inl.inc + cxxflags = $third_party_cxxflags + +# //absl/debugging:symbolize +build $absl/debugging/symbolize.a: ar $absl/debugging/symbolize.o +build $absl/debugging/symbolize.o: cxx $absl/debugging/symbolize.cc | $ + $absl/debugging/symbolize_elf.inc + cxxflags = $third_party_cxxflags + +# //absl/numeric:int128 +build $absl/numeric/int128.a: ar $absl/numeric/int128.o +build $absl/numeric/int128.o: cxx $absl/numeric/int128.cc | $ + $absl/numeric/int128_have_intrinsic.inc $ + $absl/numeric/int128_no_intrinsic.inc + cxxflags = $third_party_cxxflags + +# //absl/profiling:exponential_biased +build $absl/profiling/exponential_biased.a: ar $ + $absl/profiling/internal/exponential_biased.o +build $absl/profiling/internal/exponential_biased.o: cxx $ + $absl/profiling/internal/exponential_biased.cc + cxxflags = $third_party_cxxflags + +# //absl/strings +build $absl/strings/strings.a: ar $absl/strings/ascii.o $ + $absl/strings/charconv.o $absl/strings/escaping.o $ + $absl/strings/internal/charconv_bigint.o $ + $absl/strings/internal/charconv_parse.o $absl/strings/internal/memutil.o $ + $absl/strings/match.o $absl/strings/numbers.o $absl/strings/str_cat.o $ + $absl/strings/str_replace.o $absl/strings/str_split.o $ + $absl/strings/string_view.o $absl/strings/substitute.o +build $absl/strings/ascii.o: cxx $absl/strings/ascii.cc + cxxflags = $third_party_cxxflags +build $absl/strings/charconv.o: cxx $absl/strings/charconv.cc + cxxflags = $third_party_cxxflags +build $absl/strings/escaping.o: cxx $absl/strings/escaping.cc + cxxflags = $third_party_cxxflags +build $absl/strings/internal/charconv_bigint.o: cxx $ + $absl/strings/internal/charconv_bigint.cc + cxxflags = $third_party_cxxflags +build $absl/strings/internal/charconv_parse.o: cxx $ + $absl/strings/internal/charconv_parse.cc + cxxflags = $third_party_cxxflags +build $absl/strings/internal/memutil.o: cxx $absl/strings/internal/memutil.cc + cxxflags = $third_party_cxxflags +build $absl/strings/match.o: cxx $absl/strings/match.cc + cxxflags = $third_party_cxxflags +build $absl/strings/numbers.o: cxx $absl/strings/numbers.cc + cxxflags = $third_party_cxxflags +build $absl/strings/str_cat.o: cxx $absl/strings/str_cat.cc + cxxflags = $third_party_cxxflags +build $absl/strings/str_replace.o: cxx $absl/strings/str_replace.cc + cxxflags = $third_party_cxxflags +build $absl/strings/str_split.o: cxx $absl/strings/str_split.cc + cxxflags = $third_party_cxxflags +build $absl/strings/string_view.o: cxx $absl/strings/string_view.cc + cxxflags = $third_party_cxxflags +build $absl/strings/substitute.o: cxx $absl/strings/substitute.cc + cxxflags = $third_party_cxxflags + +# //absl/strings:cord +build $absl/strings/cord.a: ar $absl/strings/cord.o +build $absl/strings/cord.o: cxx $absl/strings/cord.cc + cxxflags = $third_party_cxxflags + +# //absl/strings:cord_internal +build $absl/strings/cord_internal.a: ar $absl/strings/internal/cord_internal.o $ + $absl/strings/internal/cord_rep_btree.o $ + $absl/strings/internal/cord_rep_btree_navigator.o $ + $absl/strings/internal/cord_rep_btree_reader.o $ + $absl/strings/internal/cord_rep_consume.o $ + $absl/strings/internal/cord_rep_ring.o +build $absl/strings/internal/cord_internal.o: cxx $ + $absl/strings/internal/cord_internal.cc + cxxflags = $third_party_cxxflags +build $absl/strings/internal/cord_rep_btree.o: cxx $ + $absl/strings/internal/cord_rep_btree.cc + cxxflags = $third_party_cxxflags +build $absl/strings/internal/cord_rep_btree_navigator.o: cxx $ + $absl/strings/internal/cord_rep_btree_navigator.cc + cxxflags = $third_party_cxxflags +build $absl/strings/internal/cord_rep_btree_reader.o: cxx $ + $absl/strings/internal/cord_rep_btree_reader.cc + cxxflags = $third_party_cxxflags +build $absl/strings/internal/cord_rep_consume.o: cxx $ + $absl/strings/internal/cord_rep_consume.cc + cxxflags = $third_party_cxxflags +build $absl/strings/internal/cord_rep_ring.o: cxx $ + $absl/strings/internal/cord_rep_ring.cc + cxxflags = $third_party_cxxflags + +# //absl/strings:cordz_functions +build $absl/strings/cordz_functions.a: ar $ + $absl/strings/internal/cordz_functions.o +build $absl/strings/internal/cordz_functions.o: cxx $ + $absl/strings/internal/cordz_functions.cc + cxxflags = $third_party_cxxflags + +# //absl/strings:cordz_handle +build $absl/strings/cordz_handle.a: ar $absl/strings/internal/cordz_handle.o +build $absl/strings/internal/cordz_handle.o: cxx $ + $absl/strings/internal/cordz_handle.cc + cxxflags = $third_party_cxxflags + +# //absl/strings:cordz_info +build $absl/strings/cordz_info.a: ar $absl/strings/internal/cordz_info.o +build $absl/strings/internal/cordz_info.o: cxx $ + $absl/strings/internal/cordz_info.cc + cxxflags = $third_party_cxxflags + +# //absl/strings:internal +build $absl/strings/internal.a: ar $absl/strings/internal/escaping.o $ + $absl/strings/internal/ostringstream.o $absl/strings/internal/utf8.o +build $absl/strings/internal/escaping.o: cxx $absl/strings/internal/escaping.cc + cxxflags = $third_party_cxxflags +build $absl/strings/internal/ostringstream.o: cxx $ + $absl/strings/internal/ostringstream.cc + cxxflags = $third_party_cxxflags +build $absl/strings/internal/utf8.o: cxx $absl/strings/internal/utf8.cc + cxxflags = $third_party_cxxflags + +# //absl/synchronization +build $absl/synchronization/synchronization.a: ar $ + $absl/synchronization/barrier.o $absl/synchronization/blocking_counter.o $ + $absl/synchronization/internal/create_thread_identity.o $ + $absl/synchronization/internal/per_thread_sem.o $ + $absl/synchronization/internal/waiter.o $ + $absl/synchronization/notification.o $absl/synchronization/mutex.o +build $absl/synchronization/barrier.o: cxx $absl/synchronization/barrier.cc + cxxflags = $third_party_cxxflags +build $absl/synchronization/blocking_counter.o: cxx $ + $absl/synchronization/blocking_counter.cc + cxxflags = $third_party_cxxflags +build $absl/synchronization/internal/create_thread_identity.o: cxx $ + $absl/synchronization/internal/create_thread_identity.cc + cxxflags = $third_party_cxxflags +build $absl/synchronization/internal/per_thread_sem.o: cxx $ + $absl/synchronization/internal/per_thread_sem.cc + cxxflags = $third_party_cxxflags +build $absl/synchronization/internal/waiter.o: cxx $ + $absl/synchronization/internal/waiter.cc + cxxflags = $third_party_cxxflags +build $absl/synchronization/notification.o: cxx $ + $absl/synchronization/notification.cc + cxxflags = $third_party_cxxflags +build $absl/synchronization/mutex.o: cxx $absl/synchronization/mutex.cc + cxxflags = $third_party_cxxflags + +# //absl/synchronization:graphcycles_internal +build $absl/synchronization/graphcycles_internal.a: ar $ + $absl/synchronization/internal/graphcycles.o +build $absl/synchronization/internal/graphcycles.o: cxx $ + $absl/synchronization/internal/graphcycles.cc + cxxflags = $third_party_cxxflags + +# //absl/time +build $absl/time/time.a: ar $absl/time/civil_time.o $absl/time/clock.o $ + $absl/time/duration.o $absl/time/format.o $absl/time/absl/time.o +build $absl/time/civil_time.o: cxx $absl/time/civil_time.cc + cxxflags = $third_party_cxxflags +build $absl/time/clock.o: cxx $absl/time/clock.cc | $ + $absl/time/internal/get_current_time_posix.inc + cxxflags = $third_party_cxxflags +build $absl/time/duration.o: cxx $absl/time/duration.cc + cxxflags = $third_party_cxxflags +build $absl/time/format.o: cxx $absl/time/format.cc + cxxflags = $third_party_cxxflags +build $absl/time/absl/time.o: cxx $absl/time/time.cc + cxxflags = $third_party_cxxflags + +# //absl/time:civil_time +build $absl/time/civil_time.a: ar $ + $absl/time/internal/cctz/src/civil_time_detail.o +build $absl/time/internal/cctz/src/civil_time_detail.o: cxx $ + $absl/time/internal/cctz/src/civil_time_detail.cc + cxxflags = $third_party_cxxflags + +# //absl/time:time_zone +build $absl/time/time_zone.a: ar $ + $absl/time/internal/cctz/src/time_zone_fixed.o $ + $absl/time/internal/cctz/src/time_zone_format.o $ + $absl/time/internal/cctz/src/time_zone_if.o $ + $absl/time/internal/cctz/src/time_zone_impl.o $ + $absl/time/internal/cctz/src/time_zone_info.o $ + $absl/time/internal/cctz/src/time_zone_libc.o $ + $absl/time/internal/cctz/src/time_zone_lookup.o $ + $absl/time/internal/cctz/src/time_zone_posix.o $ + $absl/time/internal/cctz/src/zone_info_source.o +build $absl/time/internal/cctz/src/time_zone_fixed.o: cxx $ + $absl/time/internal/cctz/src/time_zone_fixed.cc + cxxflags = $third_party_cxxflags +build $absl/time/internal/cctz/src/time_zone_format.o: cxx $ + $absl/time/internal/cctz/src/time_zone_format.cc + cxxflags = $third_party_cxxflags +build $absl/time/internal/cctz/src/time_zone_if.o: cxx $ + $absl/time/internal/cctz/src/time_zone_if.cc + cxxflags = $third_party_cxxflags +build $absl/time/internal/cctz/src/time_zone_impl.o: cxx $ + $absl/time/internal/cctz/src/time_zone_impl.cc + cxxflags = $third_party_cxxflags +build $absl/time/internal/cctz/src/time_zone_info.o: cxx $ + $absl/time/internal/cctz/src/time_zone_info.cc + cxxflags = $third_party_cxxflags +build $absl/time/internal/cctz/src/time_zone_libc.o: cxx $ + $absl/time/internal/cctz/src/time_zone_libc.cc + cxxflags = $third_party_cxxflags +build $absl/time/internal/cctz/src/time_zone_lookup.o: cxx $ + $absl/time/internal/cctz/src/time_zone_lookup.cc + cxxflags = $third_party_cxxflags +build $absl/time/internal/cctz/src/time_zone_posix.o: cxx $ + $absl/time/internal/cctz/src/time_zone_posix.cc + cxxflags = $third_party_cxxflags +build $absl/time/internal/cctz/src/zone_info_source.o: cxx $ + $absl/time/internal/cctz/src/zone_info_source.cc + cxxflags = $third_party_cxxflags + +# // absl/types:bad_optional_access +build $absl/types/bad_optional_access.a: ar $absl/types/bad_optional_access.o +build $absl/types/bad_optional_access.o: cxx $absl/types/bad_optional_access.cc + cxxflags = $third_party_cxxflags + +# // absl/types:bad_variant_access +build $absl/types/bad_variant_access.a: ar $absl/types/bad_variant_access.o +build $absl/types/bad_variant_access.o: cxx $absl/types/bad_variant_access.cc + cxxflags = $third_party_cxxflags + +build third_party/date/src/tz.a: ar third_party/date/src/tz.o +build third_party/date/src/tz.o: cxx third_party/date/src/tz.cpp + cxxflags = $third_party_cflags -DINSTALL=. + +build third_party/glew/src/glew.a: ar third_party/glew/src/glew.o +build third_party/glew/src/glew.o: cc third_party/glew/src/glew.c + cflags = $third_party_cflags -DGLEW_EGL + +default glplanet diff --git a/buildconf/dbg.ninja b/buildconf/dbg.ninja new file mode 100644 index 0000000..b43df19 --- /dev/null +++ b/buildconf/dbg.ninja @@ -0,0 +1,20 @@ +# Copyright 2021 Google LLC +# +# 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. + +third_party_cflags = -Og -g3 + +cxxflags = -Og -g3 -Werror +third_party_cxxflags = -Og -g3 + +subninja buildconf/common.ninja diff --git a/buildconf/fastbuild.ninja b/buildconf/fastbuild.ninja new file mode 100644 index 0000000..c321e30 --- /dev/null +++ b/buildconf/fastbuild.ninja @@ -0,0 +1,17 @@ +# Copyright 2021 Google LLC +# +# 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. + +cxxflags = -Werror + +subninja buildconf/common.ninja diff --git a/buildconf/release.ninja b/buildconf/release.ninja new file mode 100644 index 0000000..8f5dd1b --- /dev/null +++ b/buildconf/release.ninja @@ -0,0 +1,29 @@ +# Copyright 2021 Google LLC +# +# 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. + +third_party_cflags = -Werror=format -Werror=format-security -Wdate-time -D_FORTIFY_SOURCE=2 -O3 -DNDEBUG -fstack-protector-strong -ffunction-sections -fdata-sections -flto + +# Don't set -Werror in general; we don't want to risk future warnings appearing +# in GCC's -Wall/-Wextra and breaking the build. +# +# Most of these flags come from Debian's dpkg-buildflags, with the exception +# that we aim for correctness with -O3, rather than just -O2. +cxxflags = -Werror=format-security -Wdate-time -D_FORTIFY_SOURCE=2 -O3 -DNDEBUG -DGLPLANET_DISABLE_EGL_THREAD_SAFETY_CHECKS -DGLPLANET_DISABLE_GL_THREAD_SAFETY_CHECKS -DGLPLANET_DISABLE_AGGRESSIVE_ERROR_CHECKING -fstack-protector-strong -ffunction-sections -fdata-sections +#-flto +third_party_cxxflags = -D_FORTIFY_SOURCE=2 -O3 -DNDEBUG -fstack-protector-strong -ffunction-sections -fdata-sections +#-flto + +ldflags = -flto -Wl,-O2 -Wl,-z,relro -Wl,--gc-sections -Wl,--as-needed + +subninja buildconf/common.ninja |