From fb990ac4a8ecb1c4939f9bfe983214af39dcdca3 Mon Sep 17 00:00:00 2001 From: apio Date: Tue, 1 Nov 2022 22:26:49 +0100 Subject: [PATCH] Build with -Wall, -Wextra, -Werror and -pedantic Helps a lot, I've discovered in the past months. --- CMakeLists.txt | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/CMakeLists.txt b/CMakeLists.txt index 6013ef4..daf9da5 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -73,6 +73,12 @@ target_include_directories(sapphirec PUBLIC src) target_include_directories(sapphirec PUBLIC src/external/tclap-1.2.5/include) target_include_directories(sapphirec PUBLIC src/external) target_precompile_headers(sapphirec PUBLIC src/sapphirepch.h) +set_property(TARGET sapphirec PROPERTY COMPILE_WARNING_AS_ERROR ON) + +target_compile_options(sapphirec PRIVATE + $<$:/W4> + $<$>:-Wall -Wextra -Wpedantic> +) llvm_map_components_to_libnames(llvm_libs all core support irreader x86asmparser x86codegen x86desc x86disassembler x86info x86targetmca aarch64asmparser aarch64codegen aarch64desc aarch64disassembler aarch64info aarch64utils)