Currently, the only way to cross-compile using vcpkg_configure_make is to use a gcc cross toolchain with the target as the prefix. This is not how you cross compile with clang--with clang you set CMAKE_<LANG>_COMPILER_TARGET. This detects this from the toolchain file ...
The documentation forCMAKE_<LANG>_COMPILER_TARGET,https://cmake.org/cmake/help/latest/variable/CMAKE_LANG_COMPILER_TARGET.html, says: This variable may only be set in a toolchain file specified by the CMAKE_TOOLCHAIN_FILE variable. However in practice in one test I did, it worked just f...
注意:必须先include(CheckCXXCompilerFlag) 例子1:在检查当前编译器是否支持c++11 CHECK_CXX_COMPILER_FLAG("-std=c++11" COMPILER_SUPPORTS_CXX11) CHECK_CXX_COMPILER_FLAG("-std=c++0x"COMPILER_SUPPORTS_CXX0X) if(COMPILER_SUPPORTS_CXX11) set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std...