From fede9f3f8d72acd531f17c2ac7c4ee0bffa58c0c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Vladim=C3=ADr=20Vondru=C5=A1?= Date: Tue, 5 Jan 2016 14:56:20 +0100 Subject: [PATCH] Math: fix test compilation on XCode. See file comment for details. Yet another instance of the problem described in #37. --- src/Magnum/CMakeLists.txt | 3 ++- src/Magnum/Math/dummy.cpp | 30 ++++++++++++++++++++++++++++++ 2 files changed, 32 insertions(+), 1 deletion(-) create mode 100644 src/Magnum/Math/dummy.cpp diff --git a/src/Magnum/CMakeLists.txt b/src/Magnum/CMakeLists.txt index 124c16061..95e8f6f2f 100644 --- a/src/Magnum/CMakeLists.txt +++ b/src/Magnum/CMakeLists.txt @@ -310,7 +310,8 @@ endif() if(BUILD_TESTS) # Library with graceful assert for testing add_library(MagnumMathTestLib ${SHARED_OR_STATIC} - $) + $ + Math/dummy.cpp) # XCode workaround, see file comment for details set_target_properties(MagnumMathTestLib PROPERTIES COMPILE_FLAGS "-DCORRADE_GRACEFUL_ASSERT" DEBUG_POSTFIX "-d") diff --git a/src/Magnum/Math/dummy.cpp b/src/Magnum/Math/dummy.cpp new file mode 100644 index 000000000..4bb556a95 --- /dev/null +++ b/src/Magnum/Math/dummy.cpp @@ -0,0 +1,30 @@ +/* + This file is part of Magnum. + + Copyright © 2010, 2011, 2012, 2013, 2014, 2015 + Vladimír Vondruš + + Permission is hereby granted, free of charge, to any person obtaining a + copy of this software and associated documentation files (the "Software"), + to deal in the Software without restriction, including without limitation + the rights to use, copy, modify, merge, publish, distribute, sublicense, + and/or sell copies of the Software, and to permit persons to whom the + Software is furnished to do so, subject to the following conditions: + + The above copyright notice and this permission notice shall be included + in all copies or substantial portions of the Software. + + THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL + THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING + FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + DEALINGS IN THE SOFTWARE. +*/ + +/* XCode-generated project files have a limitation that you can't create a + library target from OBJECT sources only and you have to provide at least one + file. Otherwise the generated library gets replaced with self-pointing + symlink and the build then obviously fails with "File not found" error. That + affected the MagnumMathTestLib library and this file should fix it. */