mirror of
https://github.com/reactos/CMake.git
synced 2024-12-15 15:48:52 +00:00
9784af1b50
This new policy restricts the addition of the shared library link flags to executables only when the ENABLE_EXPORTS property is set to True.
16 lines
624 B
CMake
16 lines
624 B
CMake
function(BuildTargetInSubProject P T E)
|
|
try_compile(RESULTVAR
|
|
${CMAKE_CURRENT_BINARY_DIR}/subproject
|
|
${CMAKE_CURRENT_SOURCE_DIR}/subproject
|
|
${P} ${T} OUTPUT_VARIABLE O)
|
|
if(E AND RESULTVAR)
|
|
message(STATUS "${P} target ${T} succeeded as expected")
|
|
elseif(E AND NOT RESULTVAR)
|
|
message(FATAL_ERROR "${P} target ${T} failed but should have succeeded. Output:${O}")
|
|
elseif(NOT E AND NOT RESULTVAR)
|
|
message(STATUS "${P} target ${T} failed as expected")
|
|
elseif(NOT E AND RESULTVAR)
|
|
message(FATAL_ERROR "${P} target ${T} succeeded but should have failed. Output:${O}")
|
|
endif()
|
|
endfunction()
|