mirror of
https://github.com/Kitware/CMake.git
synced 2026-05-04 05:10:10 -05:00
@@ -494,6 +494,9 @@ add_RunCMake_test(File_Generate)
|
|||||||
add_RunCMake_test(ExportWithoutLanguage)
|
add_RunCMake_test(ExportWithoutLanguage)
|
||||||
add_RunCMake_test(target_link_directories)
|
add_RunCMake_test(target_link_directories)
|
||||||
add_RunCMake_test(target_link_libraries)
|
add_RunCMake_test(target_link_libraries)
|
||||||
|
add_RunCMake_test(target_link_libraries-ALIAS)
|
||||||
|
add_RunCMake_test(target_link_libraries-LINK_LANGUAGE)
|
||||||
|
add_RunCMake_test(target_link_libraries-LINK_LANG_AND_ID)
|
||||||
add_RunCMake_test(add_link_options -DCMAKE_C_COMPILER_ID=${CMAKE_C_COMPILER_ID})
|
add_RunCMake_test(add_link_options -DCMAKE_C_COMPILER_ID=${CMAKE_C_COMPILER_ID})
|
||||||
add_RunCMake_test(target_link_options -DCMAKE_C_COMPILER_ID=${CMAKE_C_COMPILER_ID}
|
add_RunCMake_test(target_link_options -DCMAKE_C_COMPILER_ID=${CMAKE_C_COMPILER_ID}
|
||||||
-DCMake_TEST_CUDA=${CMake_TEST_CUDA})
|
-DCMake_TEST_CUDA=${CMake_TEST_CUDA})
|
||||||
|
|||||||
@@ -0,0 +1,3 @@
|
|||||||
|
cmake_minimum_required(VERSION 3.1)
|
||||||
|
project(${RunCMake_TEST} NONE)
|
||||||
|
include(${RunCMake_TEST}.cmake NO_POLICY_SCOPE)
|
||||||
@@ -0,0 +1,23 @@
|
|||||||
|
include(RunCMake)
|
||||||
|
|
||||||
|
macro(run_cmake_target test subtest target)
|
||||||
|
set(RunCMake_TEST_BINARY_DIR ${RunCMake_BINARY_DIR}/${test}-build)
|
||||||
|
set(RunCMake_TEST_NO_CLEAN 1)
|
||||||
|
run_cmake_command(${test}-${subtest} ${CMAKE_COMMAND} --build . --target ${target} ${ARGN})
|
||||||
|
|
||||||
|
unset(RunCMake_TEST_BINARY_DIR)
|
||||||
|
unset(RunCMake_TEST_NO_CLEAN)
|
||||||
|
endmacro()
|
||||||
|
|
||||||
|
set(RunCMake_TEST_OUTPUT_MERGE TRUE)
|
||||||
|
if (NOT RunCMake_GENERATOR_IS_MULTI_CONFIG)
|
||||||
|
set(RunCMake_TEST_OPTIONS -DCMAKE_BUILD_TYPE=Release)
|
||||||
|
endif()
|
||||||
|
run_cmake(AliasTargets)
|
||||||
|
run_cmake_target(AliasTargets func func --config Release)
|
||||||
|
run_cmake_target(AliasTargets lib-local lib-local --config Release)
|
||||||
|
run_cmake_target(AliasTargets main-local main-local --config Release)
|
||||||
|
run_cmake_target(AliasTargets lib-global lib-global --config Release)
|
||||||
|
run_cmake_target(AliasTargets main-global main-global --config Release)
|
||||||
|
unset(RunCMake_TEST_OPTIONS)
|
||||||
|
unset(RunCMake_TEST_OUTPUT_MERGE)
|
||||||
@@ -0,0 +1,10 @@
|
|||||||
|
|
||||||
|
#if defined(_WIN32)
|
||||||
|
__declspec(dllimport)
|
||||||
|
#endif
|
||||||
|
void func_c();
|
||||||
|
|
||||||
|
void lib()
|
||||||
|
{
|
||||||
|
func_c();
|
||||||
|
}
|
||||||
@@ -0,0 +1,3 @@
|
|||||||
|
cmake_minimum_required(VERSION 3.1)
|
||||||
|
project(${RunCMake_TEST} NONE)
|
||||||
|
include(${RunCMake_TEST}.cmake NO_POLICY_SCOPE)
|
||||||
@@ -0,0 +1,41 @@
|
|||||||
|
include(RunCMake)
|
||||||
|
|
||||||
|
macro(run_cmake_target test subtest target)
|
||||||
|
set(RunCMake_TEST_BINARY_DIR ${RunCMake_BINARY_DIR}/${test}-build)
|
||||||
|
set(RunCMake_TEST_NO_CLEAN 1)
|
||||||
|
run_cmake_command(${test}-${subtest} ${CMAKE_COMMAND} --build . --target ${target} ${ARGN})
|
||||||
|
|
||||||
|
unset(RunCMake_TEST_BINARY_DIR)
|
||||||
|
unset(RunCMake_TEST_NO_CLEAN)
|
||||||
|
endmacro()
|
||||||
|
|
||||||
|
run_cmake(genex_LINK_LANGUAGE-bad-usage)
|
||||||
|
|
||||||
|
if (RunCMake_GENERATOR MATCHES "Makefiles|Ninja|Visual Studio|Xcode|Watcom WMake")
|
||||||
|
|
||||||
|
run_cmake(genex_LINK_LANGUAGE-bad-mix-lang)
|
||||||
|
|
||||||
|
set(RunCMake_TEST_OUTPUT_MERGE TRUE)
|
||||||
|
if (NOT RunCMake_GENERATOR_IS_MULTI_CONFIG)
|
||||||
|
set(RunCMake_TEST_OPTIONS -DCMAKE_BUILD_TYPE=Release)
|
||||||
|
endif()
|
||||||
|
|
||||||
|
run_cmake(genex_LINK_LANGUAGE)
|
||||||
|
|
||||||
|
run_cmake_target(genex_LINK_LANGUAGE lib LinkLibraries_lib --config Release)
|
||||||
|
run_cmake_target(genex_LINK_LANGUAGE lib2 LinkLibraries_lib2 --config Release)
|
||||||
|
run_cmake_target(genex_LINK_LANGUAGE lib3 LinkLibraries_lib3 --config Release)
|
||||||
|
run_cmake_target(genex_LINK_LANGUAGE exe LinkLibraries_exe --config Release)
|
||||||
|
run_cmake_target(genex_LINK_LANGUAGE C_import LinkLibraries_C_import --config Release)
|
||||||
|
run_cmake_target(genex_LINK_LANGUAGE CXX_import LinkLibraries_CXX_import --config Release)
|
||||||
|
run_cmake_target(genex_LINK_LANGUAGE C_interface LinkLibraries_C_interface --config Release)
|
||||||
|
run_cmake_target(genex_LINK_LANGUAGE CXX_interface LinkLibraries_CXX_interface --config Release)
|
||||||
|
run_cmake_target(genex_LINK_LANGUAGE C_interface2 LinkLibraries_C_interface2 --config Release)
|
||||||
|
run_cmake_target(genex_LINK_LANGUAGE CXX_interface2 LinkLibraries_CXX_interface2 --config Release)
|
||||||
|
run_cmake_target(genex_LINK_LANGUAGE C_static LinkLibraries_C_static --config Release)
|
||||||
|
run_cmake_target(genex_LINK_LANGUAGE CXX_static LinkLibraries_CXX_static --config Release)
|
||||||
|
|
||||||
|
unset(RunCMake_TEST_OPTIONS)
|
||||||
|
unset(RunCMake_TEST_OUTPUT_MERGE)
|
||||||
|
|
||||||
|
endif()
|
||||||
@@ -0,0 +1,7 @@
|
|||||||
|
|
||||||
|
#if defined(_WIN32)
|
||||||
|
__declspec(dllexport)
|
||||||
|
#endif
|
||||||
|
void func_c()
|
||||||
|
{
|
||||||
|
}
|
||||||
@@ -0,0 +1,10 @@
|
|||||||
|
|
||||||
|
#if defined(_WIN32)
|
||||||
|
__declspec(dllimport)
|
||||||
|
#endif
|
||||||
|
void func_c();
|
||||||
|
|
||||||
|
void lib()
|
||||||
|
{
|
||||||
|
func_c();
|
||||||
|
}
|
||||||
@@ -0,0 +1,12 @@
|
|||||||
|
|
||||||
|
#if defined(_WIN32)
|
||||||
|
__declspec(dllimport)
|
||||||
|
#endif
|
||||||
|
void func_c();
|
||||||
|
|
||||||
|
int main()
|
||||||
|
{
|
||||||
|
func_c();
|
||||||
|
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
@@ -0,0 +1,3 @@
|
|||||||
|
cmake_minimum_required(VERSION 3.1)
|
||||||
|
project(${RunCMake_TEST} NONE)
|
||||||
|
include(${RunCMake_TEST}.cmake NO_POLICY_SCOPE)
|
||||||
@@ -0,0 +1,38 @@
|
|||||||
|
include(RunCMake)
|
||||||
|
|
||||||
|
macro(run_cmake_target test subtest target)
|
||||||
|
set(RunCMake_TEST_BINARY_DIR ${RunCMake_BINARY_DIR}/${test}-build)
|
||||||
|
set(RunCMake_TEST_NO_CLEAN 1)
|
||||||
|
run_cmake_command(${test}-${subtest} ${CMAKE_COMMAND} --build . --target ${target} ${ARGN})
|
||||||
|
|
||||||
|
unset(RunCMake_TEST_BINARY_DIR)
|
||||||
|
unset(RunCMake_TEST_NO_CLEAN)
|
||||||
|
endmacro()
|
||||||
|
|
||||||
|
if (RunCMake_GENERATOR MATCHES "Makefiles|Ninja|Visual Studio|Xcode|Watcom WMake")
|
||||||
|
|
||||||
|
run_cmake(genex_LINK_LANG_AND_ID-bad-mix-lang)
|
||||||
|
|
||||||
|
set(RunCMake_TEST_OUTPUT_MERGE TRUE)
|
||||||
|
if (NOT RunCMake_GENERATOR_IS_MULTI_CONFIG)
|
||||||
|
set(RunCMake_TEST_OPTIONS -DCMAKE_BUILD_TYPE=Release)
|
||||||
|
endif()
|
||||||
|
|
||||||
|
run_cmake(genex_LINK_LANG_AND_ID)
|
||||||
|
|
||||||
|
run_cmake_target(genex_LINK_LANG_AND_ID lib LinkLibraries_lib --config Release)
|
||||||
|
run_cmake_target(genex_LINK_LANG_AND_ID lib2 LinkLibraries_lib2 --config Release)
|
||||||
|
run_cmake_target(genex_LINK_LANG_AND_ID lib3 LinkLibraries_lib3 --config Release)
|
||||||
|
run_cmake_target(genex_LINK_LANG_AND_ID exe LinkLibraries_exe --config Release)
|
||||||
|
run_cmake_target(genex_LINK_LANG_AND_ID C_import LinkLibraries_C_import --config Release)
|
||||||
|
run_cmake_target(genex_LINK_LANG_AND_ID CXX_import LinkLibraries_CXX_import --config Release)
|
||||||
|
run_cmake_target(genex_LINK_LANG_AND_ID C_interface LinkLibraries_C_interface --config Release)
|
||||||
|
run_cmake_target(genex_LINK_LANG_AND_ID CXX_interface LinkLibraries_CXX_interface --config Release)
|
||||||
|
run_cmake_target(genex_LINK_LANG_AND_ID C_interface2 LinkLibraries_C_interface2 --config Release)
|
||||||
|
run_cmake_target(genex_LINK_LANG_AND_ID CXX_interface2 LinkLibraries_CXX_interface2 --config Release)
|
||||||
|
run_cmake_target(genex_LINK_LANG_AND_ID CXX_static LinkLibraries_CXX_static --config Release)
|
||||||
|
|
||||||
|
unset(RunCMake_TEST_OPTIONS)
|
||||||
|
unset(RunCMake_TEST_OUTPUT_MERGE)
|
||||||
|
|
||||||
|
endif()
|
||||||
@@ -0,0 +1,7 @@
|
|||||||
|
|
||||||
|
#if defined(_WIN32)
|
||||||
|
__declspec(dllexport)
|
||||||
|
#endif
|
||||||
|
void func_c()
|
||||||
|
{
|
||||||
|
}
|
||||||
@@ -0,0 +1,7 @@
|
|||||||
|
|
||||||
|
#if defined(_WIN32)
|
||||||
|
__declspec(dllexport)
|
||||||
|
#endif
|
||||||
|
void func_cxx()
|
||||||
|
{
|
||||||
|
}
|
||||||
@@ -0,0 +1,10 @@
|
|||||||
|
|
||||||
|
#if defined(_WIN32)
|
||||||
|
__declspec(dllimport)
|
||||||
|
#endif
|
||||||
|
void func_c();
|
||||||
|
|
||||||
|
void lib()
|
||||||
|
{
|
||||||
|
func_c();
|
||||||
|
}
|
||||||
@@ -0,0 +1,12 @@
|
|||||||
|
|
||||||
|
#if defined(_WIN32)
|
||||||
|
__declspec(dllimport)
|
||||||
|
#endif
|
||||||
|
void func_c();
|
||||||
|
|
||||||
|
int main()
|
||||||
|
{
|
||||||
|
func_c();
|
||||||
|
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
@@ -0,0 +1,12 @@
|
|||||||
|
|
||||||
|
#if defined(_WIN32)
|
||||||
|
__declspec(dllimport)
|
||||||
|
#endif
|
||||||
|
void func_cxx();
|
||||||
|
|
||||||
|
int main()
|
||||||
|
{
|
||||||
|
func_cxx();
|
||||||
|
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
@@ -30,71 +30,3 @@ run_cmake(StaticPrivateDepNotExported)
|
|||||||
run_cmake(StaticPrivateDepNotTarget)
|
run_cmake(StaticPrivateDepNotTarget)
|
||||||
run_cmake(UNKNOWN-IMPORTED-GLOBAL)
|
run_cmake(UNKNOWN-IMPORTED-GLOBAL)
|
||||||
run_cmake(empty_keyword_args)
|
run_cmake(empty_keyword_args)
|
||||||
|
|
||||||
macro(run_cmake_target test subtest target)
|
|
||||||
set(RunCMake_TEST_BINARY_DIR ${RunCMake_BINARY_DIR}/${test}-build)
|
|
||||||
set(RunCMake_TEST_NO_CLEAN 1)
|
|
||||||
run_cmake_command(${test}-${subtest} ${CMAKE_COMMAND} --build . --target ${target} ${ARGN})
|
|
||||||
|
|
||||||
unset(RunCMake_TEST_BINARY_DIR)
|
|
||||||
unset(RunCMake_TEST_NO_CLEAN)
|
|
||||||
endmacro()
|
|
||||||
|
|
||||||
set(RunCMake_TEST_OUTPUT_MERGE TRUE)
|
|
||||||
if (NOT RunCMake_GENERATOR_IS_MULTI_CONFIG)
|
|
||||||
set(RunCMake_TEST_OPTIONS -DCMAKE_BUILD_TYPE=Release)
|
|
||||||
endif()
|
|
||||||
run_cmake(AliasTargets)
|
|
||||||
run_cmake_target(AliasTargets func func --config Release)
|
|
||||||
run_cmake_target(AliasTargets lib-local lib-local --config Release)
|
|
||||||
run_cmake_target(AliasTargets main-local main-local --config Release)
|
|
||||||
run_cmake_target(AliasTargets lib-global lib-global --config Release)
|
|
||||||
run_cmake_target(AliasTargets main-global main-global --config Release)
|
|
||||||
unset(RunCMake_TEST_OPTIONS)
|
|
||||||
unset(RunCMake_TEST_OUTPUT_MERGE)
|
|
||||||
|
|
||||||
run_cmake(genex_LINK_LANGUAGE-bad-usage)
|
|
||||||
|
|
||||||
if (RunCMake_GENERATOR MATCHES "Makefiles|Ninja|Visual Studio|Xcode|Watcom WMake")
|
|
||||||
|
|
||||||
run_cmake(genex_LINK_LANGUAGE-bad-mix-lang)
|
|
||||||
run_cmake(genex_LINK_LANG_AND_ID-bad-mix-lang)
|
|
||||||
|
|
||||||
set(RunCMake_TEST_OUTPUT_MERGE TRUE)
|
|
||||||
if (NOT RunCMake_GENERATOR_IS_MULTI_CONFIG)
|
|
||||||
set(RunCMake_TEST_OPTIONS -DCMAKE_BUILD_TYPE=Release)
|
|
||||||
endif()
|
|
||||||
|
|
||||||
run_cmake(genex_LINK_LANGUAGE)
|
|
||||||
|
|
||||||
run_cmake_target(genex_LINK_LANGUAGE lib LinkLibraries_lib --config Release)
|
|
||||||
run_cmake_target(genex_LINK_LANGUAGE lib2 LinkLibraries_lib2 --config Release)
|
|
||||||
run_cmake_target(genex_LINK_LANGUAGE lib3 LinkLibraries_lib3 --config Release)
|
|
||||||
run_cmake_target(genex_LINK_LANGUAGE exe LinkLibraries_exe --config Release)
|
|
||||||
run_cmake_target(genex_LINK_LANGUAGE C_import LinkLibraries_C_import --config Release)
|
|
||||||
run_cmake_target(genex_LINK_LANGUAGE CXX_import LinkLibraries_CXX_import --config Release)
|
|
||||||
run_cmake_target(genex_LINK_LANGUAGE C_interface LinkLibraries_C_interface --config Release)
|
|
||||||
run_cmake_target(genex_LINK_LANGUAGE CXX_interface LinkLibraries_CXX_interface --config Release)
|
|
||||||
run_cmake_target(genex_LINK_LANGUAGE C_interface2 LinkLibraries_C_interface2 --config Release)
|
|
||||||
run_cmake_target(genex_LINK_LANGUAGE CXX_interface2 LinkLibraries_CXX_interface2 --config Release)
|
|
||||||
run_cmake_target(genex_LINK_LANGUAGE C_static LinkLibraries_C_static --config Release)
|
|
||||||
run_cmake_target(genex_LINK_LANGUAGE CXX_static LinkLibraries_CXX_static --config Release)
|
|
||||||
|
|
||||||
run_cmake(genex_LINK_LANG_AND_ID)
|
|
||||||
|
|
||||||
run_cmake_target(genex_LINK_LANG_AND_ID lib LinkLibraries_lib --config Release)
|
|
||||||
run_cmake_target(genex_LINK_LANG_AND_ID lib2 LinkLibraries_lib2 --config Release)
|
|
||||||
run_cmake_target(genex_LINK_LANG_AND_ID lib3 LinkLibraries_lib3 --config Release)
|
|
||||||
run_cmake_target(genex_LINK_LANG_AND_ID exe LinkLibraries_exe --config Release)
|
|
||||||
run_cmake_target(genex_LINK_LANG_AND_ID C_import LinkLibraries_C_import --config Release)
|
|
||||||
run_cmake_target(genex_LINK_LANG_AND_ID CXX_import LinkLibraries_CXX_import --config Release)
|
|
||||||
run_cmake_target(genex_LINK_LANG_AND_ID C_interface LinkLibraries_C_interface --config Release)
|
|
||||||
run_cmake_target(genex_LINK_LANG_AND_ID CXX_interface LinkLibraries_CXX_interface --config Release)
|
|
||||||
run_cmake_target(genex_LINK_LANG_AND_ID C_interface2 LinkLibraries_C_interface2 --config Release)
|
|
||||||
run_cmake_target(genex_LINK_LANG_AND_ID CXX_interface2 LinkLibraries_CXX_interface2 --config Release)
|
|
||||||
run_cmake_target(genex_LINK_LANG_AND_ID CXX_static LinkLibraries_CXX_static --config Release)
|
|
||||||
|
|
||||||
unset(RunCMake_TEST_OPTIONS)
|
|
||||||
unset(RunCMake_TEST_OUTPUT_MERGE)
|
|
||||||
|
|
||||||
endif()
|
|
||||||
|
|||||||
Reference in New Issue
Block a user