From cb0af4057e78defd12822092c6fd9bf074b60164 Mon Sep 17 00:00:00 2001 From: comex Date: Wed, 29 Oct 2014 00:01:41 -0400 Subject: [PATCH] Link Foundation/CoreServices into unit tests so they build with DISABLE_WX. --- CMakeLists.txt | 1 + Source/UnitTests/CMakeLists.txt | 6 +++++- 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 96c326166f..e039121ac4 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -278,6 +278,7 @@ if(APPLE) find_library(COREAUDIO_LIBRARY CoreAudio) find_library(COREFUND_LIBRARY CoreFoundation) find_library(CORESERV_LIBRARY CoreServices) + find_library(FOUNDATION_LIBRARY foundation) find_library(IOB_LIBRARY IOBluetooth) find_library(IOK_LIBRARY IOKit) find_library(QUICKTIME_LIBRARY QuickTime) diff --git a/Source/UnitTests/CMakeLists.txt b/Source/UnitTests/CMakeLists.txt index e625f5ffe9..bfe197fcfb 100644 --- a/Source/UnitTests/CMakeLists.txt +++ b/Source/UnitTests/CMakeLists.txt @@ -1,3 +1,7 @@ +set(LIBS core gtest) +if(${CMAKE_SYSTEM_NAME} MATCHES "Darwin") + list(APPEND LIBS ${FOUNDATION_LIBRARY} ${CORESERV_LIBRARY}) +endif() 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 @@ -9,7 +13,7 @@ macro(add_dolphin_test target srcs) add_custom_command(TARGET Test_${target} PRE_LINK COMMAND mkdir -p ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/Tests) - target_link_libraries(Test_${target} core gtest) + target_link_libraries(Test_${target} ${LIBS}) add_dependencies(unittests Test_${target}) add_test(NAME ${target} COMMAND ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/Tests/${target}) endmacro(add_dolphin_test)