diff --git a/CMakeLists.txt b/CMakeLists.txt index 516c209b..c3cdbc7f 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -504,8 +504,13 @@ endif() # For macOS (MA_APPLE_DESKTOP, "Darwin" in CMake), the code uses CoreAudio that does not need Objective-C. # For the other Apple platforms, the code uses AVFoundation that requires Objective-C. if(APPLE AND NOT (CMAKE_SYSTEM_NAME STREQUAL "Darwin")) - enable_language(OBJC) - set_source_files_properties(miniaudio.c PROPERTIES LANGUAGE OBJC) + if(MINIAUDIO_FORCE_CXX) + enable_language(OBJCXX) + set_source_files_properties(miniaudio.c PROPERTIES LANGUAGE OBJCXX) + else() + enable_language(OBJC) + set_source_files_properties(miniaudio.c PROPERTIES LANGUAGE OBJC) + endif() endif() # Static Libraries