summaryrefslogtreecommitdiff
path: root/cmake/compiler_warnings.cmake
diff options
context:
space:
mode:
Diffstat (limited to 'cmake/compiler_warnings.cmake')
-rw-r--r--cmake/compiler_warnings.cmake7
1 files changed, 7 insertions, 0 deletions
diff --git a/cmake/compiler_warnings.cmake b/cmake/compiler_warnings.cmake
new file mode 100644
index 0000000..bc557eb
--- /dev/null
+++ b/cmake/compiler_warnings.cmake
@@ -0,0 +1,7 @@
+function(set_project_warnings target)
+ if (MSVC)
+ target_compile_options(${target} PRIVATE /W4 /permissive-)
+ else()
+ target_compile_options(${target} PRIVATE -Wall -Wextra -Wpedantic -Werror)
+ endif()
+endfunction()