diff options
-rw-r--r-- | Tests/ExportImport/Import/A/CMakeLists.txt | 30 |
1 files changed, 30 insertions, 0 deletions
diff --git a/Tests/ExportImport/Import/A/CMakeLists.txt b/Tests/ExportImport/Import/A/CMakeLists.txt index 9450c82..358776b 100644 --- a/Tests/ExportImport/Import/A/CMakeLists.txt +++ b/Tests/ExportImport/Import/A/CMakeLists.txt @@ -311,6 +311,21 @@ if (((CMAKE_C_COMPILER_ID STREQUAL GNU AND CMAKE_C_COMPILER_VERSION VERSION_GREA message(SEND_ERROR "EXP_ERROR_VARIABLE try_compile failed, but it was expected to succeed ${OUTPUT}.") endif() + if(NOT CMAKE_CROSSCOMPILING) + unset(EXP_RUN_VAR CACHE) + unset(EXP_COMPILE_VAR CACHE) + try_run(EXP_RUN_VAR EXP_COMPILE_VAR + "${CMAKE_CURRENT_SOURCE_DIR}/test_system" + "${CMAKE_CURRENT_SOURCE_DIR}/test_system.cpp" + COMPILE_DEFINITIONS "-Wunused-variable -Werror=unused-variable" + LINK_LIBRARIES exp_systemlib + OUTPUT_VARIABLE OUTPUT + ) + if(NOT EXP_COMPILE_VAR) + message(SEND_ERROR "try_run compile failed, but it was expected to succeed ${OUTPUT}.") + endif() + endif() + add_executable(test_system_bld test_system.cpp) target_link_libraries(test_system_bld bld_systemlib) target_compile_options(test_system_bld PRIVATE -Wunused-variable -Werror=unused-variable) @@ -326,5 +341,20 @@ if (((CMAKE_C_COMPILER_ID STREQUAL GNU AND CMAKE_C_COMPILER_VERSION VERSION_GREA if(NOT BLD_ERROR_VARIABLE) message(SEND_ERROR "BLD_ERROR_VARIABLE try_compile failed, but it was expected to succeed.") endif() + + if(NOT CMAKE_CROSSCOMPILING) + unset(BLD_RUN_VAR CACHE) + unset(BLD_COMPILE_VAR CACHE) + try_run(BLD_RUN_VAR BLD_COMPILE_VAR + "${CMAKE_CURRENT_SOURCE_DIR}/test_system" + "${CMAKE_CURRENT_SOURCE_DIR}/test_system.cpp" + COMPILE_DEFINITIONS "-Wunused-variable -Werror=unused-variable" + LINK_LIBRARIES bld_systemlib + OUTPUT_VARIABLE OUTPUT + ) + if(NOT BLD_COMPILE_VAR) + message(SEND_ERROR "try_run compile failed, but it was expected to succeed ${OUTPUT}.") + endif() + endif() endif() endif() |