diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index 6ccaef349..d8025b3b4 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -151,6 +151,23 @@ else( WIN32 ) include_directories( ${FPU_CONTROL_DIR} ) add_definitions( -DHAVE_FPU_CONTROL ) endif( FPU_CONTROL_DIR ) + + include( CheckCXXSourceCompiles ) + CHECK_CXX_SOURCE_COMPILES( + "#include + int main() { va_list list1, list2; va_copy(list1, list2); return 0; }" + HAS_VA_COPY ) + if( NOT HAS_VA_COPY ) + CHECK_CXX_SOURCE_COMPILES( + "#include + int main() { va_list list1, list2; __va_copy(list1, list2); return 0; }" + HAS___VA_COPY ) + if( HAS___VA_COPY ) + add_definitions( -Dva_copy=__va_copy ) + else( HAS___VA_COPY ) + message( SEND_ERROR "Compiler does not support va_copy or __va_copy" ) + endif( HAS___VA_COPY ) + endif( NOT HAS_VA_COPY ) endif( WIN32 ) # Decide on the name of the FMOD library we want to use.