Cross-compiled build fails with new gtest configuration
The conda-forge-based cross-compiled osx-arm64 build (run on osx-x86_64 hardware) for 2.8.2 is failing because the gtest
configuration is attempting to run a cross-compiled executable:
[ 18%] Linking CXX executable test_data_types
cd /Users/duncanmacleod/opt/mambaforge/conda-bld/ldas-tools-framecpp_1655974064255/work/_build/src/storage/data && /Users/duncanmacleod/opt/mambaforge/conda-bld/ldas-tools-framecpp_1655974064255/_build_env/bin/cmake -E cmake_link_script CMakeFiles/test_data_types.dir/link.txt --verbose=1
/Users/duncanmacleod/opt/mambaforge/conda-bld/ldas-tools-framecpp_1655974064255/_build_env/bin/arm64-apple-darwin20.0.0-clang++ -ftree-vectorize -fPIC -fPIE -fstack-protector-strong -O2 -pipe -stdlib=libc++ -fvisibility-inlines-hidden -fmessage-length=0 -isystem /Users/duncanmacleod/opt/mambaforge/conda-bld/ldas-tools-framecpp_1655974064255/_h_env_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehol/include -fdebug-prefix-map=/Users/duncanmacleod/opt/mambaforge/conda-bld/ldas-tools-framecpp_1655974064255/work=/usr/local/src/conda/ldas-tools-framecpp-2.8.2 -fdebug-prefix-map=/Users/duncanmacleod/opt/mambaforge/conda-bld/ldas-tools-framecpp_1655974064255/_h_env_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehol=/usr/local/src/conda-prefix -O2 -g -DNDEBUG -arch arm64 -isysroot /Users/duncanmacleod/opt/MacOSX11.0.sdk -mmacosx-version-min=11.0 -Wl,-search_paths_first -Wl,-headerpad_max_install_names -Wl,-pie -Wl,-headerpad_max_install_names -Wl,-dead_strip_dylibs -Wl,-rpath,/Users/duncanmacleod/opt/mambaforge/conda-bld/ldas-tools-framecpp_1655974064255/_h_env_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehol/lib -L/Users/duncanmacleod/opt/mambaforge/conda-bld/ldas-tools-framecpp_1655974064255/_h_env_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehol/lib CMakeFiles/test_data_types.dir/data_types_test.cc.o -o test_data_types /Users/duncanmacleod/opt/mambaforge/conda-bld/ldas-tools-framecpp_1655974064255/_h_env_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehol/lib/libgtest.1.11.0.dylib /Users/duncanmacleod/opt/mambaforge/conda-bld/ldas-tools-framecpp_1655974064255/_h_env_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehol/lib/libldastoolsal.dylib
cd /Users/duncanmacleod/opt/mambaforge/conda-bld/ldas-tools-framecpp_1655974064255/work/_build/src/storage/data && /Users/duncanmacleod/opt/mambaforge/conda-bld/ldas-tools-framecpp_1655974064255/_build_env/bin/cmake -D TEST_TARGET=test_data_types -D TEST_EXECUTABLE=/Users/duncanmacleod/opt/mambaforge/conda-bld/ldas-tools-framecpp_1655974064255/work/_build/src/storage/data/test_data_types -D TEST_EXECUTOR= -D TEST_WORKING_DIR=/Users/duncanmacleod/opt/mambaforge/conda-bld/ldas-tools-framecpp_1655974064255/work/_build/src/storage/data -D "TEST_EXTRA_ARGS=--gtest_death_test_style=fast;--gtest_catch_exceptions=1" -D TEST_PROPERTIES= -D TEST_PREFIX= -D TEST_SUFFIX= -D TEST_FILTER= -D NO_PRETTY_TYPES=FALSE -D NO_PRETTY_VALUES=FALSE -D TEST_LIST=test_data_types_TESTS -D CTEST_FILE=/Users/duncanmacleod/opt/mambaforge/conda-bld/ldas-tools-framecpp_1655974064255/work/_build/src/storage/data/test_data_types[1]_tests.cmake -D TEST_DISCOVERY_TIMEOUT=5 -D TEST_XML_OUTPUT_DIR= -P /Users/duncanmacleod/opt/mambaforge/conda-bld/ldas-tools-framecpp_1655974064255/_build_env/share/cmake-3.23/Modules/GoogleTestAddTests.cmake
CMake Error at /Users/duncanmacleod/opt/mambaforge/conda-bld/ldas-tools-framecpp_1655974064255/_build_env/share/cmake-3.23/Modules/GoogleTestAddTests.cmake:112 (message):
Error running test executable.
Path: '/Users/duncanmacleod/opt/mambaforge/conda-bld/ldas-tools-framecpp_1655974064255/work/_build/src/storage/data/test_data_types'
Result: Bad CPU type in executable
Output:
Call Stack (most recent call first):
/Users/duncanmacleod/opt/mambaforge/conda-bld/ldas-tools-framecpp_1655974064255/_build_env/share/cmake-3.23/Modules/GoogleTestAddTests.cmake:225 (gtest_discover_tests_impl)
Setting the standard CTest -DBUILD_TESTING:BOOL=off
variable doesn't help.
Can the GTest configuration be protected so that cross-compiled executables aren't attempted to be run when they will fail?
Edited by Duncan Macleod