Build with -Wall, -Wextra, -Werror and -pedantic

Helps a lot, I've discovered in the past months.
This commit is contained in:
apio 2022-11-01 22:26:49 +01:00
parent dbd5627fe6
commit fb990ac4a8

View File

@ -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
$<$<CXX_COMPILER_ID:MSVC>:/W4>
$<$<NOT:$<CXX_COMPILER_ID:MSVC>>:-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)