Sfoglia il codice sorgente

Enable warnings for tools and samples in VS

1vanK 3 anni fa
parent
commit
a4ff37245f
2 ha cambiato i file con 13 aggiunte e 1 eliminazioni
  1. 1 1
      Source/Urho3D/CMakeLists.txt
  2. 12 0
      cmake/Modules/UrhoCommon.cmake

+ 1 - 1
Source/Urho3D/CMakeLists.txt

@@ -6,7 +6,7 @@ set (TARGET_NAME Urho3D)
 
 if (MSVC)
     # Set warning level for Urho3D project
-    add_compile_options(/W3)
+    add_compile_options (/W3)
 endif ()
 
 # Prevent ICE from old MinGW versions, workaround from the GCC bugzilla https://gcc.gnu.org/bugzilla/show_bug.cgi?id=61189

+ 12 - 0
cmake/Modules/UrhoCommon.cmake

@@ -1500,6 +1500,12 @@ endmacro ()
 #  TARGET_PROPERTIES - list of target properties
 macro (setup_executable)
     cmake_parse_arguments (ARG "PRIVATE;TOOL;NODEPS" "" "" ${ARGN})
+
+    if (MSVC)
+        # Set warning level
+        add_compile_options (/W3)
+    endif ()
+
     check_source_files ()
     add_executable (${TARGET_NAME} ${ARG_UNPARSED_ARGUMENTS} ${SOURCE_FILES})
     set (RUNTIME_DIR ${CMAKE_RUNTIME_OUTPUT_DIRECTORY})
@@ -1630,6 +1636,12 @@ endmacro ()
 #  TARGET_PROPERTIES - list of target properties
 macro (setup_main_executable)
     cmake_parse_arguments (ARG "NOBUNDLE;MACOSX_BUNDLE;WIN32" "" "" ${ARGN})
+
+    if (MSVC)
+        # Set warning level
+        add_compile_options (/W3)
+    endif ()
+
     if (NOT RESOURCE_DIRS)
         define_resource_dirs ()
     endif ()