summaryrefslogtreecommitdiff
path: root/cmake/Modules/AddCompilerRT.cmake
diff options
context:
space:
mode:
Diffstat (limited to 'cmake/Modules/AddCompilerRT.cmake')
-rw-r--r--cmake/Modules/AddCompilerRT.cmake12
1 files changed, 7 insertions, 5 deletions
diff --git a/cmake/Modules/AddCompilerRT.cmake b/cmake/Modules/AddCompilerRT.cmake
index 78663353c..34afc10a4 100644
--- a/cmake/Modules/AddCompilerRT.cmake
+++ b/cmake/Modules/AddCompilerRT.cmake
@@ -295,13 +295,15 @@ endif()
# OBJECTS <object files>
# DEPS <deps (e.g. runtime libs)>
# LINK_FLAGS <link flags>)
-macro(add_compiler_rt_test test_suite test_name)
+function(add_compiler_rt_test test_suite test_name)
cmake_parse_arguments(TEST "" "SUBDIR" "OBJECTS;DEPS;LINK_FLAGS" "" ${ARGN})
- set(output_bin ${CMAKE_CURRENT_BINARY_DIR})
+ set(output_dir ${CMAKE_CURRENT_BINARY_DIR})
if(TEST_SUBDIR)
- set(output_bin "${output_bin}/${TEST_SUBDIR}")
+ set(output_dir "${output_dir}/${TEST_SUBDIR}")
endif()
- set(output_bin "${output_bin}/${CMAKE_CFG_RESOLVED_INTDIR}${test_name}")
+ set(output_dir "${output_dir}/${CMAKE_CFG_INTDIR}")
+ file(MAKE_DIRECTORY "${output_dir}")
+ set(output_bin "${output_dir}/${test_name}")
if(MSVC)
set(output_bin "${output_bin}.exe")
endif()
@@ -329,7 +331,7 @@ macro(add_compiler_rt_test test_suite test_name)
# Make the test suite depend on the binary.
add_dependencies(${test_suite} ${test_name})
-endmacro()
+endfunction()
macro(add_compiler_rt_resource_file target_name file_name component)
set(src_file "${CMAKE_CURRENT_SOURCE_DIR}/${file_name}")