Browse Source

CompileCheck: Fix check_flag for MSVC

pull/1/merge
Daniel Scharrer 9 years ago
parent
commit
0fa8498256
  1. 6
      cmake/CompileCheck.cmake

6
cmake/CompileCheck.cmake

@ -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)

Loading…
Cancel
Save