[MSVC]
[reactos.git] / reactos / cmake / msvc.cmake
index 50a7472..75cfe9a 100644 (file)
@@ -48,8 +48,9 @@ endif ()
 # - C4244: implicit integer truncation
 # - C4290: C++ exception specification ignored
 # - C4800: forcing value to bool 'true' or 'false' (performance warning)
-#add_compile_flags("/wd4244 /wd4290 /wd4800 ")
-add_compile_flags("/wd4244 /wd4290 /wd4800")
+# - C4200: nonstandard extension used : zero-sized array in struct/union
+# - C4214: nonstandard extension used : bit field types other than int
+add_compile_flags("/wd4244 /wd4290 /wd4800 /wd4200 /wd4214")
 
 # FIXME: Temporarily disable C4018 until we fix more of the others. CORE-10113
 add_compile_flags("/wd4018")
@@ -108,7 +109,7 @@ if(RUNTIME_CHECKS)
 endif()
 
 set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} /MANIFEST:NO /INCREMENTAL:NO /SAFESEH:NO /NODEFAULTLIB /RELEASE")
-set(CMAKE_SHARED_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS} /MANIFEST:NO /INCREMENTAL:NO /SAFESEH:NO /NODEFAULTLIB /RELEASE")
+set(CMAKE_SHARED_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS} /MANIFEST:NO /INCREMENTAL:NO /SAFESEH:NO /NODEFAULTLIB /RELEASE /IGNORE:4104")
 set(CMAKE_MODULE_LINKER_FLAGS "${CMAKE_MODULE_LINKER_FLAGS} /MANIFEST:NO /INCREMENTAL:NO /SAFESEH:NO /NODEFAULTLIB /RELEASE")
 
 if(CMAKE_DISABLE_NINJA_DEPSLOG)
@@ -353,10 +354,10 @@ function(spec2def _dllname _spec_file)
         DEPENDS ${CMAKE_CURRENT_SOURCE_DIR}/${_spec_file} native-spec2def)
 
     if(__spec2def_ADD_IMPORTLIB)
-        # TODO: NO_PRIVATE_WARNINGS should add /IGNORE:4104 to the link command
-        #       line. However that should be on all command lines outside of
-        #       generate_import_lib in the first place.
         generate_import_lib(lib${_file} ${_dllname} ${_spec_file})
+        if(__spec2def_NO_PRIVATE_WARNINGS)
+            add_target_property(lib${_file} STATIC_LIBRARY_FLAGS "/ignore:4104")
+        endif()
     endif()
 endfunction()