mirror of https://github.com/microsoft/vcpkg.git
18 lines
785 B
Diff
18 lines
785 B
Diff
diff --git a/CMakeLists.txt b/CMakeLists.txt
|
|
index dcd594b..a357b90 100644
|
|
--- a/CMakeLists.txt
|
|
+++ b/CMakeLists.txt
|
|
@@ -174,6 +174,12 @@ ELSE(HAVE_CLOCK_GETTIME_RT)
|
|
CHECK_SYMBOL_EXISTS(clock_gettime "time.h" HAVE_CLOCK_GETTIME_SYMBOL)
|
|
# then check that it's available
|
|
IF(HAVE_CLOCK_GETTIME_SYMBOL)
|
|
+ if(CMAKE_CROSSCOMPILING)
|
|
+ # Seed try_run results. Override in triplet if needed.
|
|
+ set(HAVE_CLOCK_GETTIME_RUN 0 CACHE STRING "")
|
|
+ set(CMAKE_TRY_COMPILE_TARGET_TYPE EXECUTABLE)
|
|
+ try_compile(HAVE_CLOCK_GETTIME_COMP SOURCES ${CMAKE_CURRENT_SOURCE_DIR}/check_clock_gettime.c)
|
|
+ endif()
|
|
TRY_RUN(HAVE_CLOCK_GETTIME_RUN HAVE_CLOCK_GETTIME_COMP
|
|
${CMAKE_CURRENT_BINARY_DIR}
|
|
${CMAKE_CURRENT_SOURCE_DIR}/check_clock_gettime.c
|