From d59944511da0c2b62f2e631ef682b0ed3ff610f2 Mon Sep 17 00:00:00 2001 From: Marek Kotewicz Date: Wed, 29 Apr 2015 10:24:13 +0200 Subject: [PATCH] XCODE_ATTRIBUTE_CLANG_CXX_LIBRARY for libjsengine --- libjsengine/CMakeLists.txt | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/libjsengine/CMakeLists.txt b/libjsengine/CMakeLists.txt index 039e3d162..20de06d1d 100644 --- a/libjsengine/CMakeLists.txt +++ b/libjsengine/CMakeLists.txt @@ -8,10 +8,6 @@ endif() set(CMAKE_AUTOMOC OFF) -# macos brew version of v8 needs to be compiled with libstdc++ -# it also needs to be dynamic library -set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -stdlib=libstdc++") - aux_source_directory(. SRC_LIST) include_directories(BEFORE ..) @@ -23,6 +19,14 @@ file(GLOB HEADERS "*.h") add_library(${EXECUTABLE} ${SRC_LIST} ${HEADERS}) +# macos brew version of v8 needs to be compiled with libstdc++ +# it also needs to be dynamic library +# xcode needs libstdc++ to be explicitly set as it's attribute +if (APPLE) + set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -stdlib=libstdc++") + set_property(TARGET ${EXECUTABLE} PROPERTY XCODE_ATTRIBUTE_CLANG_CXX_LIBRARY "libstdc++") +endif() + target_link_libraries(${EXECUTABLE} ${V8_LIBRARIES}) install( TARGETS ${EXECUTABLE} RUNTIME DESTINATION bin ARCHIVE DESTINATION lib LIBRARY DESTINATION lib )