summaryrefslogtreecommitdiffstats
path: root/Tests
diff options
context:
space:
mode:
Diffstat (limited to 'Tests')
-rw-r--r--Tests/RunCMake/BuildDepends/LinkDependsCheck.cmake3
-rw-r--r--Tests/RunCMake/BuildDepends/RunCMakeTest.cmake4
-rw-r--r--Tests/RunCMake/CMakeLists.txt2
-rw-r--r--Tests/RunCMake/add_subdirectory/RunCMakeTest.cmake2
-rw-r--r--Tests/RunCMake/add_subdirectory/System.cmake3
-rw-r--r--Tests/RunCMake/add_subdirectory/System/CMakeLists.txt5
-rw-r--r--Tests/RunCMake/add_subdirectory/System/SubSub1/CMakeLists.txt1
-rw-r--r--Tests/RunCMake/add_subdirectory/System/zap.f0
8 files changed, 16 insertions, 4 deletions
diff --git a/Tests/RunCMake/BuildDepends/LinkDependsCheck.cmake b/Tests/RunCMake/BuildDepends/LinkDependsCheck.cmake
index a21096b..596e1eb 100644
--- a/Tests/RunCMake/BuildDepends/LinkDependsCheck.cmake
+++ b/Tests/RunCMake/BuildDepends/LinkDependsCheck.cmake
@@ -2,7 +2,8 @@
enable_language(C)
file(WRITE "${CMAKE_BINARY_DIR}/LinkDependsUseLinker.cmake"
- "set(CMAKE_C_LINK_DEPENDS_USE_LINKER \"${CMAKE_C_LINK_DEPENDS_USE_LINKER}\")\n")
+ "set(CMAKE_LINK_DEPENDS_USE_LINKER ${CMAKE_LINK_DEPENDS_USE_LINKER})
+set(CMAKE_C_LINK_DEPENDS_USE_LINKER ${CMAKE_C_LINK_DEPENDS_USE_LINKER})\n")
file(GENERATE OUTPUT "${CMAKE_CURRENT_BINARY_DIR}/check-$<LOWER_CASE:$<CONFIG>>.cmake"
diff --git a/Tests/RunCMake/BuildDepends/RunCMakeTest.cmake b/Tests/RunCMake/BuildDepends/RunCMakeTest.cmake
index dfa4f49..fada37a 100644
--- a/Tests/RunCMake/BuildDepends/RunCMakeTest.cmake
+++ b/Tests/RunCMake/BuildDepends/RunCMakeTest.cmake
@@ -199,12 +199,12 @@ endif()
run_BuildDepends(CustomCommandUnityBuild)
unset(run_BuildDepends_skip_step_2)
-#if (RunCMake_GENERATOR MATCHES "Make|Ninja" AND CMAKE_C_LINK_DEPENDS_USE_LINKER)
if (RunCMake_GENERATOR MATCHES "Make|Ninja")
set(run_BuildDepends_skip_step_2 1)
run_BuildDepends(LinkDependsCheck)
include("${RunCMake_BINARY_DIR}/LinkDependsCheck-build/LinkDependsUseLinker.cmake")
- if (CMAKE_C_LINK_DEPENDS_USE_LINKER)
+ if ((NOT DEFINED CMAKE_LINK_DEPENDS_USE_LINKER OR CMAKE_LINK_DEPENDS_USE_LINKER)
+ AND CMAKE_C_LINK_DEPENDS_USE_LINKER)
run_BuildDepends(LinkDependsExternalLibrary)
unset(run_BuildDepends_skip_step_2)
run_BuildDepends(LinkDepends)
diff --git a/Tests/RunCMake/CMakeLists.txt b/Tests/RunCMake/CMakeLists.txt
index f089a96..63b7568 100644
--- a/Tests/RunCMake/CMakeLists.txt
+++ b/Tests/RunCMake/CMakeLists.txt
@@ -452,7 +452,7 @@ add_RunCMake_test(add_custom_target)
add_RunCMake_test(add_dependencies)
add_RunCMake_test(add_executable)
add_RunCMake_test(add_library)
-add_RunCMake_test(add_subdirectory)
+add_RunCMake_test(add_subdirectory -DCMAKE_Fortran_COMPILER=${CMAKE_Fortran_COMPILER})
add_RunCMake_test(add_test)
add_RunCMake_test(build_command)
add_executable(exit_code exit_code.c)
diff --git a/Tests/RunCMake/add_subdirectory/RunCMakeTest.cmake b/Tests/RunCMake/add_subdirectory/RunCMakeTest.cmake
index ddf45af..3c70d07 100644
--- a/Tests/RunCMake/add_subdirectory/RunCMakeTest.cmake
+++ b/Tests/RunCMake/add_subdirectory/RunCMakeTest.cmake
@@ -3,7 +3,9 @@ include(RunCMake)
run_cmake(DoesNotExist)
run_cmake(Missing)
run_cmake(Function)
+set(RunCMake_TEST_OPTIONS -DCMAKE_Fortran_COMPILER=${CMAKE_Fortran_COMPILER})
run_cmake(System)
+unset(RunCMake_TEST_OPTIONS)
macro(run_cmake_install case)
set(RunCMake_TEST_BINARY_DIR ${RunCMake_BINARY_DIR}/${case}-build)
diff --git a/Tests/RunCMake/add_subdirectory/System.cmake b/Tests/RunCMake/add_subdirectory/System.cmake
index 45d7d9a..1048a7a 100644
--- a/Tests/RunCMake/add_subdirectory/System.cmake
+++ b/Tests/RunCMake/add_subdirectory/System.cmake
@@ -1,4 +1,7 @@
enable_language(CXX)
+if(CMAKE_Fortran_COMPILER)
+ enable_language(Fortran)
+endif()
add_subdirectory(System SYSTEM)
diff --git a/Tests/RunCMake/add_subdirectory/System/CMakeLists.txt b/Tests/RunCMake/add_subdirectory/System/CMakeLists.txt
index ef74e80..8653b6f 100644
--- a/Tests/RunCMake/add_subdirectory/System/CMakeLists.txt
+++ b/Tests/RunCMake/add_subdirectory/System/CMakeLists.txt
@@ -4,6 +4,11 @@ add_subdirectory(SubSub1 SYSTEM)
add_subdirectory(SubSub2)
add_library(bar STATIC bar.cpp)
+if(CMAKE_Fortran_COMPILER)
+ target_sources(bar PRIVATE zap.f)
+endif()
+# Verify CMAKE_INCLUDE_SYSTEM_FLAG_<LANG> works
+target_link_libraries(bar PRIVATE subsub1bar)
add_library(foo STATIC foo.cpp)
set_target_properties(foo PROPERTIES SYSTEM OFF)
diff --git a/Tests/RunCMake/add_subdirectory/System/SubSub1/CMakeLists.txt b/Tests/RunCMake/add_subdirectory/System/SubSub1/CMakeLists.txt
index 291339b..24105b0 100644
--- a/Tests/RunCMake/add_subdirectory/System/SubSub1/CMakeLists.txt
+++ b/Tests/RunCMake/add_subdirectory/System/SubSub1/CMakeLists.txt
@@ -1,4 +1,5 @@
add_library(subsub1bar STATIC bar.cpp)
+target_include_directories(subsub1bar PUBLIC ${CMAKE_CURRENT_BINARY_DIR})
add_library(subsub1foo STATIC foo.cpp)
set_target_properties(subsub1foo PROPERTIES SYSTEM OFF)
diff --git a/Tests/RunCMake/add_subdirectory/System/zap.f b/Tests/RunCMake/add_subdirectory/System/zap.f
new file mode 100644
index 0000000..e69de29
--- /dev/null
+++ b/Tests/RunCMake/add_subdirectory/System/zap.f