Disable tests and encoding check when cross compiling
This commit is contained in:
parent
f0451439ae
commit
62f8e75b34
@ -35,15 +35,27 @@ option(SLIC3R_ASAN "Enable ASan on Clang and GCC" 0)
|
|||||||
|
|
||||||
set(SLIC3R_GTK "2" CACHE STRING "GTK version to use with wxWidgets on Linux")
|
set(SLIC3R_GTK "2" CACHE STRING "GTK version to use with wxWidgets on Linux")
|
||||||
|
|
||||||
|
set(IS_CROSS_COMPILE FALSE)
|
||||||
|
|
||||||
if (APPLE)
|
if (APPLE)
|
||||||
set(CMAKE_FIND_FRAMEWORK LAST)
|
set(CMAKE_FIND_FRAMEWORK LAST)
|
||||||
set(CMAKE_FIND_APPBUNDLE LAST)
|
set(CMAKE_FIND_APPBUNDLE LAST)
|
||||||
|
list(FIND CMAKE_OSX_ARCHITECTURES ${CMAKE_SYSTEM_PROCESSOR} _arch_idx)
|
||||||
|
if (CMAKE_OSX_ARCHITECTURES AND _arch_idx LESS 0)
|
||||||
|
set(IS_CROSS_COMPILE TRUE)
|
||||||
|
endif ()
|
||||||
endif ()
|
endif ()
|
||||||
|
|
||||||
# Proposal for C++ unit tests and sandboxes
|
# Proposal for C++ unit tests and sandboxes
|
||||||
option(SLIC3R_BUILD_SANDBOXES "Build development sandboxes" OFF)
|
option(SLIC3R_BUILD_SANDBOXES "Build development sandboxes" OFF)
|
||||||
option(SLIC3R_BUILD_TESTS "Build unit tests" ON)
|
option(SLIC3R_BUILD_TESTS "Build unit tests" ON)
|
||||||
|
|
||||||
|
if (IS_CROSS_COMPILE)
|
||||||
|
message("Detected cross compilation setup. Tests and encoding checks will be forcedly disabled!")
|
||||||
|
set(SLIC3R_PERL_XS OFF CACHE BOOL "" FORCE)
|
||||||
|
set(SLIC3R_BUILD_TESTS OFF CACHE BOOL "" FORCE)
|
||||||
|
endif ()
|
||||||
|
|
||||||
# Print out the SLIC3R_* cache options
|
# Print out the SLIC3R_* cache options
|
||||||
get_cmake_property(_cache_vars CACHE_VARIABLES)
|
get_cmake_property(_cache_vars CACHE_VARIABLES)
|
||||||
list (SORT _cache_vars)
|
list (SORT _cache_vars)
|
||||||
|
@ -1,6 +1,11 @@
|
|||||||
|
|
||||||
option(SLIC3R_ENC_CHECK "Verify encoding of source files" 1)
|
option(SLIC3R_ENC_CHECK "Verify encoding of source files" 1)
|
||||||
|
|
||||||
|
if (IS_CROSS_COMPILE)
|
||||||
|
# Force disable due to cross compilation. This fact is already printed on cli for users
|
||||||
|
set(SLIC3R_ENC_CHECK OFF CACHE BOOL "" FORCE)
|
||||||
|
endif ()
|
||||||
|
|
||||||
if (SLIC3R_ENC_CHECK)
|
if (SLIC3R_ENC_CHECK)
|
||||||
add_executable(encoding-check encoding-check.cpp)
|
add_executable(encoding-check encoding-check.cpp)
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user