Browse Source

coreaudio-encoder: Fix cmake for mingw

This prevents windres to catch up '-Wno-multichar' as an option which is
unknown to it.  This flag was added in commit
aa0e64b7c9c331f69a73f56c9b7fcc4d27bd72df
Biswapriyo Nath 4 years ago
parent
commit
e6ff2b6729
1 changed files with 6 additions and 5 deletions
  1. 6 5
      plugins/coreaudio-encoder/CMakeLists.txt

+ 6 - 5
plugins/coreaudio-encoder/CMakeLists.txt

@@ -4,17 +4,18 @@ set(coreaudio-encoder_SOURCES
 	encoder.cpp)
 
 if (WIN32)
+	# Set compiler flag before adding resource file
+	if (MINGW)
+		set_source_files_properties(${coreaudio-encoder_SOURCES}
+			PROPERTIES COMPILE_FLAGS "-Wno-multichar")
+	endif()
+
 	set(MODULE_DESCRIPTION "OBS Core Audio encoder")
 	configure_file(${CMAKE_SOURCE_DIR}/cmake/winrc/obs-module.rc.in coreaudio-encoder.rc)
 	list(APPEND coreaudio-encoder_SOURCES
 		coreaudio-encoder.rc)
 	set(coreaudio-encoder_HEADERS windows-imports.h)
 	set(coreaudio-encoder_LIBS )
-
-	if (MINGW)
-		set_source_files_properties(${coreaudio-encoder_SOURCES}
-			PROPERTIES COMPILE_FLAGS "-Wno-multichar")
-	endif()
 else()
 	find_library(COREFOUNDATION CoreFoundation)
 	find_library(COREAUDIO CoreAudio)