|
|
|
|
@ -117,7 +117,11 @@ endfunction(check_compile)
|
|
|
|
|
|
|
|
|
|
function(check_flag RESULT FLAG TYPE) |
|
|
|
|
set(compile_test_file "${CMAKE_CURRENT_BINARY_DIR}/compile_flag_test.cpp") |
|
|
|
|
file(WRITE ${compile_test_file} "__attribute__((const)) int main(){ return 0; }\n") |
|
|
|
|
if(MSVC) |
|
|
|
|
file(WRITE ${compile_test_file} "int main(){ return 0; }\n") |
|
|
|
|
else() |
|
|
|
|
file(WRITE ${compile_test_file} "__attribute__((const)) int main(){ return 0; }\n") |
|
|
|
|
endif() |
|
|
|
|
check_compile(result "${compile_test_file}" "${FLAG}" "${TYPE} flag") |
|
|
|
|
set(${RESULT} "${result}" PARENT_SCOPE) |
|
|
|
|
endfunction(check_flag) |
|
|
|
|
|