mirror of
https://github.com/TorqueGameEngines/Torque3D.git
synced 2026-02-27 18:43:48 +00:00
22 lines
462 B
CMake
22 lines
462 B
CMake
include(CheckCSourceCompiles)
|
|
|
|
macro(TEST_VARARRAYS VARIABLE)
|
|
if(NOT DEFINED ${VARIABLE})
|
|
check_c_source_compiles(
|
|
"
|
|
void main(void)
|
|
{
|
|
int foo;
|
|
foo = 10;
|
|
int array[foo];
|
|
};
|
|
"
|
|
VARARRAYS_SUPPORT)
|
|
set(${VARIABLE} ${VARARRAYS_SUPPORT} CACHE INTERNAL "C99 variable-size arrays support" FORCE)
|
|
if(${VARIABLE})
|
|
set(RESULT_TEXT "success")
|
|
else()
|
|
set(RESULT_TEXT "failed")
|
|
endif()
|
|
endif()
|
|
endmacro(TEST_VARARRAYS VARIABLE)
|