From 7417ecf67fc03e7ff06678523f4add4f1e0a365d Mon Sep 17 00:00:00 2001 From: Maarten ter Huurne Date: Mon, 5 Dec 2011 00:57:51 +0100 Subject: [PATCH] Tell the linker to not treat its input as Objective C/C++ source. Flags in CMAKE_CXX_FLAGS are passed to both compile and link commands. A cleaner solution would be to use set_source_files_properties(). However, currently there are headers (StdThread.h, maybe more) that contain Objective syntax. So it is not easy to determine exactly which source files should be compiled as Objective C/C++ and that set can quickly change when certain #include directives are modified. The solution for that would be to move all uses of Objective syntax to implementation (.cpp) files and then apply set_source_files_properties() to those. --- CMakeLists.txt | 1 + 1 file changed, 1 insertion(+) diff --git a/CMakeLists.txt b/CMakeLists.txt index 1e13aef68b..d9f5471033 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -102,6 +102,7 @@ endif() if (APPLE) set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -x objective-c++") set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -x objective-c") + set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -x none") FIND_LIBRARY(ATB_LIBRARY AudioToolbox) FIND_LIBRARY(AU_LIBRARY AudioUnit) FIND_LIBRARY(CARBON_LIBRARY Carbon)