mirror of
https://github.com/boostorg/build.git
synced 2026-02-16 13:22:11 +00:00
tune up link tests in general, asio tests specifically
[SVN r53147]
This commit is contained in:
@@ -728,7 +728,9 @@ macro(boost_library_variant LIBNAME)
|
||||
|
||||
# The basic LIBNAME target depends on each of the variants
|
||||
add_dependencies(${LIBNAME} ${VARIANT_LIBNAME})
|
||||
|
||||
|
||||
export(TARGETS ${VARIANT_LIBNAME} FILE ${CMAKE_BINARY_DIR}/exports/${VARIANT_LIBNAME}.cmake)
|
||||
|
||||
# Link against whatever libraries this library depends on
|
||||
target_link_libraries(${VARIANT_LIBNAME} ${THIS_VARIANT_LINK_LIBS})
|
||||
foreach(dependency ${THIS_LIB_DEPENDS})
|
||||
|
||||
@@ -396,7 +396,15 @@ endmacro(boost_test_compile_fail)
|
||||
#
|
||||
# boost_test_link:
|
||||
#
|
||||
# Under construction.
|
||||
#
|
||||
# Each library "exports" itself to
|
||||
# ${CMAKE_BINARY_DIR}/exports/<variantname>.cmake
|
||||
#
|
||||
# The list of 'depends' for these libraries has to match one of those
|
||||
# files, this way the export mechanism works. The generated
|
||||
# cmakelists will include() those exported .cmake files, for each
|
||||
# DEPENDS.
|
||||
#
|
||||
#
|
||||
macro(boost_test_link testname)
|
||||
boost_test_parse_args(${testname} ${ARGN} LINK)
|
||||
@@ -410,15 +418,9 @@ macro(boost_test_link testname)
|
||||
set(BOOST_TEST_INCLUDES "${BOOST_TEST_INCLUDES};${DIR}")
|
||||
endforeach(DIR ${BOOST_TEST_INCLUDE_DIRS})
|
||||
|
||||
set(TARGET_LINK_LIBRARIES_LIST "")
|
||||
foreach(DEP ${BOOST_TEST_DEPENDS})
|
||||
get_target_property(THISONE_LOCATION ${DEP} LOCATION)
|
||||
list(APPEND TARGET_LINK_LIBRARIES_LIST ${THISONE_LOCATION})
|
||||
endforeach()
|
||||
|
||||
|
||||
add_test(${BOOST_TEST_TESTNAME}
|
||||
${CMAKE_CTEST_COMMAND}
|
||||
-VV
|
||||
--build-and-test
|
||||
${Boost_SOURCE_DIR}/tools/build/CMake/LinkTest
|
||||
${Boost_BINARY_DIR}/tools/build/CMake/LinkTest
|
||||
@@ -426,11 +428,12 @@ macro(boost_test_link testname)
|
||||
--build-makeprogram ${CMAKE_MAKE_PROGRAM}
|
||||
--build-project LinkTest
|
||||
--build-options
|
||||
"-DPARENT_BINARY_DIR:FILEPATH=${CMAKE_CACHEFILE_DIR}"
|
||||
"-DBOOST_EXPORTS_DIR:FILEPATH=${CMAKE_BINARY_DIR}/exports"
|
||||
"-DSOURCE:STRING=${CMAKE_CURRENT_SOURCE_DIR}/${BOOST_TEST_SOURCES}"
|
||||
"-DINCLUDES:STRING=${BOOST_TEST_INCLUDES}"
|
||||
"-DCOMPILE_FLAGS:STRING=${BOOST_TEST_COMPILE_FLAGS}"
|
||||
"-DLINK_LIBS:STRING=${BOOST_TEST_LINK_LIBS};${TARGET_LINK_LIBRARIES_LIST}"
|
||||
"-DLINK_LIBS:STRING=${BOOST_TEST_LINK_LIBS}"
|
||||
"-DDEPENDS:STRING=${BOOST_TEST_DEPENDS}"
|
||||
)
|
||||
|
||||
set_tests_properties(${BOOST_TEST_TESTNAME}
|
||||
|
||||
@@ -1,6 +1,11 @@
|
||||
cmake_minimum_required(VERSION 2.6)
|
||||
|
||||
load_cache(${PARENT_BINARY_DIR})
|
||||
file(GLOB BOOST_EXPORTS "${BOOST_EXPORTS_DIR}/*.cmake")
|
||||
|
||||
foreach(import
|
||||
${DEPENDS})
|
||||
include(${BOOST_EXPORTS_DIR}/${import}.cmake)
|
||||
endforeach()
|
||||
|
||||
project(LinkTest)
|
||||
include_directories (${INCLUDES})
|
||||
@@ -8,5 +13,8 @@ add_executable(link-test ${SOURCE})
|
||||
set_source_files_properties(${SOURCE}
|
||||
PROPERTIES COMPILE_FLAGS "${COMPILE_FLAGS}")
|
||||
|
||||
message("DEPENDS=====${DEPENDS}")
|
||||
|
||||
target_link_libraries(link-test
|
||||
${LINK_LIBS})
|
||||
${LINK_LIBS}
|
||||
${DEPENDS})
|
||||
|
||||
Reference in New Issue
Block a user