Skip to content

Commit

Permalink
Correcting invalid linker flag for clang on other platforms
Browse files Browse the repository at this point in the history
  • Loading branch information
codemercenary committed Aug 1, 2014
1 parent baf767c commit 15bc960
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,13 @@ set(autowiring_VERSION_PATCH 0)
# Clang needs special additional flags to build with C++11
if ("${CMAKE_CXX_COMPILER_ID}" STREQUAL "Clang")
message("Clang C++11")
set(CMAKE_CXX_FLAGS "-std=c++11 -stdlib=libc++")
if (APPLE)
# Apple needs us to tell it that we're using libc++, or it will try to use libstdc++ instead
set(CMAKE_CXX_FLAGS "-std=c++11 -stdlib=libc++")
else()
set(CMAKE_CXX_FLAGS "-std=c++11")
set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -lstdc++")
endif()
elseif("${CMAKE_CXX_COMPILER_ID}" STREQUAL "GNU")
message("GCC C++11")
set(CMAKE_CXX_FLAGS "-std=c++11")
Expand Down

0 comments on commit 15bc960

Please sign in to comment.