Catch2 icon indicating copy to clipboard operation
Catch2 copied to clipboard

TARGET_OS_OSX not defined

Open tdegeus opened this issue 3 years ago • 4 comments

Building the latest release on for the conda feedstock, here https://github.com/conda-forge/catch2-feedstock/pull/37 , gives the following error on OSX:

[3/120] Building CXX object projects/CMakeFiles/SelfTest.dir/SelfTest/IntrospectiveTests/PartTracker.tests.cpp.o
FAILED: projects/CMakeFiles/SelfTest.dir/SelfTest/IntrospectiveTests/PartTracker.tests.cpp.o 
$BUILD_PREFIX/bin/x86_64-apple-darwin13.4.0-clang++  -I../include -march=core2 -mtune=haswell -mssse3 -ftree-vectorize -fPIC -fPIE -fstack-protector-strong -O2 -pipe -stdlib=libc++ -fvisibility-inlines-hidden -std=c++14 -fmessage-length=0 -isystem $PREFIX/include -fdebug-prefix-map=$SRC_DIR=/usr/local/src/conda/catch2-2.13.4 -fdebug-prefix-map=$PREFIX=/usr/local/src/conda-prefix -O3 -DNDEBUG -isysroot /Applications/Xcode_12.2.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.9.sdk -mmacosx-version-min=10.9 -Wall -Wextra -Wunreachable-code -Wpedantic -Wmissing-declarations -Wweak-vtables -Wexit-time-destructors -Wglobal-constructors -Wmissing-noreturn -MD -MT projects/CMakeFiles/SelfTest.dir/SelfTest/IntrospectiveTests/PartTracker.tests.cpp.o -MF projects/CMakeFiles/SelfTest.dir/SelfTest/IntrospectiveTests/PartTracker.tests.cpp.o.d -o projects/CMakeFiles/SelfTest.dir/SelfTest/IntrospectiveTests/PartTracker.tests.cpp.o -c ../projects/SelfTest/IntrospectiveTests/PartTracker.tests.cpp
In file included from ../projects/SelfTest/IntrospectiveTests/PartTracker.tests.cpp:9:
In file included from ../include/internal/catch_test_case_tracker.h:11:
In file included from ../include/internal/catch_compiler_capabilities.h:28:
../include/internal/catch_platform.h:14:6: error: 'TARGET_OS_OSX' is not defined, evaluates to 0 [-Werror,-Wundef-prefix=TARGET_OS_OSX]
# if TARGET_OS_OSX == 1
     ^
1 error generated.

tdegeus avatar Dec 29 '20 16:12 tdegeus

It seems indeed that TARGET_OS_OSX is not part of TargetConditionals.h? See https://opensource.apple.com/source/CarbonHeaders/CarbonHeaders-8A428/TargetConditionals.h.auto.html

tdegeus avatar Dec 30 '20 12:12 tdegeus

It's certainly not part of that 2004 Mac OS X 10.4-era version of TargetConditionals.h. It is part of later versions of TargetConditionals.h. I don't have a link for you. Your link to the old version was to CarbonHeaders; Carbon is ancient history. TargetConditionals.h is now undoubtedly considered part of some other macOS component, possibly one which is not posted to opensource.apple.com.

ryandesign avatar Mar 23 '22 07:03 ryandesign

@ryandesign Does 10.5 have it already? I never tested Catch2 on Tiger.

barracuda156 avatar Aug 17 '23 22:08 barracuda156

Does 10.5 have it already?

You can grep through the various SDK versions to determine when TARGET_OS_OSX came into existence just as well as I can, but it was added in order to distinguish macOS (which was called Mac OS X at the time) from iOS (which was iPhoneOS at the time). iPhone was introduced in 2007 but support for third-party apps was not added until iPhoneOS 2 in 2008.

ryandesign avatar Mar 20 '24 00:03 ryandesign