MSVC: ignore empty compilation units (warning LNK4221) A number of source files have their implementation #ifdef'd out (because they target another platform). MSVC warns on empty compilation units (with warning LNK4221). Ignore warning 4221 when creating the object library.
diff --git a/CMakeLists.txt b/CMakeLists.txt
index eecc22d..0e0f296 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -164,6 +164,9 @@ IF (MSVC)
# /O1 - Optimize for size
SET(CMAKE_C_FLAGS_MINSIZEREL "/DNDEBUG /O1 /Oy /GL /Gy ${CRT_FLAG_RELEASE}")
+ # /IGNORE:4221 - Ignore empty compilation units
+ SET(CMAKE_STATIC_LINKER_FLAGS "/IGNORE:4221")
+
# /DYNAMICBASE - Address space load randomization (ASLR)
# /NXCOMPAT - Data execution prevention (DEP)
# /LARGEADDRESSAWARE - >2GB user address space on x86