From 9d130b52f70a3691524a36fb1e5ba9cd9b91f084 Mon Sep 17 00:00:00 2001 From: Michael Maltese Date: Sun, 21 May 2017 23:56:35 -0700 Subject: [PATCH] CMake: use unittests_stubhost object library --- Source/UnitTests/CMakeLists.txt | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/Source/UnitTests/CMakeLists.txt b/Source/UnitTests/CMakeLists.txt index 7c7df89129..629b121b1f 100644 --- a/Source/UnitTests/CMakeLists.txt +++ b/Source/UnitTests/CMakeLists.txt @@ -6,12 +6,16 @@ if(ANDROID) set(LIBS ${LIBS} android log) endif() file(MAKE_DIRECTORY ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/Tests) + +# Since this is a Core dependency, it can't be linked as a normal library. +# Otherwise CMake inserts the library after core, but before other core +# dependencies like videocommon which also use Host_ functions, which makes the +# GNU linker complain. +add_library(unittests_stubhost OBJECT TestUtils/StubHost.cpp) + macro(add_dolphin_test target srcs) - # Since this is a Core dependency, it can't be linked as a library and has - # to be linked as an object file. Otherwise CMake inserts the library after - # core, but before other core dependencies like videocommon which also use - # Host_ functions. - set(srcs2 ${srcs} ${CMAKE_SOURCE_DIR}/Source/UnitTests/TestUtils/StubHost.cpp ${ARGN}) + + set(srcs2 ${srcs} $ ${ARGN}) add_executable(${target} EXCLUDE_FROM_ALL ${srcs2}) set_target_properties(${target} PROPERTIES OUTPUT_NAME Tests/${target}