CMake/Tests/LinkLanguage/CMakeLists.txt
Brad King 22b96543e5 ENH: Test transitive link languages
This test creates a C executable that links to a C++ static library.  On
most platforms the executable will not link unless the C++ linker is
chosen correctly.
2009-07-10 13:53:38 -04:00

11 lines
347 B
CMake

cmake_minimum_required(VERSION 2.7.20090708)
project(LinkLanguage C CXX)
add_library(foo STATIC foo.cxx)
add_executable(LinkLanguage LinkLanguage.c)
target_link_libraries(LinkLanguage foo)
# CMake should now automatically choose CXX for linking, so we need
# not set the property:
#set_property(TARGET LinkLanguage PROPERTY LINKER_LANGUAGE CXX)