Fixed cross-compiling of cmake subprojects
This commit is contained in:
parent
c5148d74a2
commit
c5d9172c3d
3 changed files with 6 additions and 3 deletions
|
@ -44,6 +44,9 @@ function (cr_add_subproject _NAME)
|
|||
if (NOT ARGS_GENERATOR)
|
||||
set (ARGS_GENERATOR ${CMAKE_GENERATOR})
|
||||
endif ()
|
||||
if (CMAKE_TOOLCHAIN_FILE)
|
||||
set (ARGS_OPTS ${ARGS_OPTS} "-DCMAKE_TOOLCHAIN_FILE=${CMAKE_TOOLCHAIN_FILE}")
|
||||
endif ()
|
||||
set (build_cmds
|
||||
CONFIGURE_COMMAND ${CMAKE_COMMAND} <SOURCE_DIR>
|
||||
-DCMAKE_INSTALL_PREFIX=${install_prefix}
|
||||
|
@ -78,7 +81,7 @@ function (cr_add_subproject _NAME)
|
|||
|
||||
if (WIN32)
|
||||
set ("${_NAME}_SHARED_LIB" "${install_prefix}/lib/${_NAME}.dll" PARENT_SCOPE)
|
||||
if (ARGS_GENERATOR MATCHES "(MSYS|MinGW) Makefiles")
|
||||
if (ARGS_GENERATOR MATCHES "(Unix|MSYS|MinGW) Makefiles")
|
||||
set ("${_NAME}_STATIC_LIB" "${install_prefix}/lib/lib${_NAME}.a" PARENT_SCOPE)
|
||||
else ()
|
||||
set ("${_NAME}_STATIC_LIB" "${install_prefix}/lib/${_NAME}.lib" PARENT_SCOPE)
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
#include <criterion/criterion.h>
|
||||
|
||||
#ifdef _WIN32
|
||||
# include <Windows.h>
|
||||
# include <windows.h>
|
||||
# define sleep(x) Sleep(x * 1000)
|
||||
#else
|
||||
# include <unistd.h>
|
||||
|
|
|
@ -28,7 +28,7 @@ extern __attribute__ ((weak)) int clock_gettime(clockid_t, struct timespec *);
|
|||
#elif defined(_WIN32) || defined(__CYGWIN__)
|
||||
# define VC_EXTRALEAN
|
||||
# define WIN32_LEAN_AND_MEAN
|
||||
# include <Windows.h>
|
||||
# include <windows.h>
|
||||
#endif
|
||||
|
||||
bool can_measure_time(void) {
|
||||
|
|
Loading…
Add table
Reference in a new issue