mirror of
https://github.com/Kitware/CMake.git
synced 2026-11-06 05:16:58 +00:00
Tests/RunCMake/Tutorial: Avoid failure on 32-bit platforms
Fixes: #27855
This commit is contained in:
1 parent
2918f600a2
commit
b847bc3be0
4 files changed
+31
-4
No files matched your search
@@ -1,8 +1,13 @@
|
||||
try_compile(out
|
||||
SOURCES ${CMAKE_CURRENT_LIST_DIR}/inspect.cpp
|
||||
try_compile(out_cxx20
|
||||
SOURCES ${CMAKE_CURRENT_LIST_DIR}/inspect_cxx20.cpp
|
||||
CXX_STANDARD 20
|
||||
)
|
||||
|
||||
try_compile(out_sse2
|
||||
SOURCES ${CMAKE_CURRENT_LIST_DIR}/inspect_sse2.cpp
|
||||
)
|
||||
|
||||
file(WRITE "${CMAKE_CURRENT_BINARY_DIR}/info.cmake"
|
||||
"set(can_build_cxx20_tutorial ${out})"
|
||||
"set(can_build_cxx20_tutorial ${out_cxx20})\n"
|
||||
"set(can_build_sse2_tutorial ${out_sse2})\n"
|
||||
)
|
||||
@@ -58,7 +58,15 @@ if(NOT can_build_cxx20_tutorial)
|
||||
return()
|
||||
endif()
|
||||
|
||||
foreach(num RANGE 4 9)
|
||||
foreach(num RANGE 4 6)
|
||||
run_tutorial_step(Step${num})
|
||||
endforeach()
|
||||
|
||||
if(NOT can_build_sse2_tutorial)
|
||||
return()
|
||||
endif()
|
||||
|
||||
foreach(num RANGE 7 9)
|
||||
run_tutorial_step(Step${num})
|
||||
endforeach()
|
||||
|
||||
|
||||
File renamed without changes.
@@ -0,0 +1,14 @@
|
||||
#if __has_include(<emmintrin.h>)
|
||||
# include <emmintrin.h>
|
||||
|
||||
double inspect(double x)
|
||||
{
|
||||
__m128d root = _mm_sqrt_sd(_mm_setzero_pd(), _mm_set_sd(x));
|
||||
return _mm_cvtsd_f64(root);
|
||||
}
|
||||
#endif
|
||||
|
||||
int main()
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
Reference in new issue
Block a user