Skip to content

Commit

Permalink
Merge pull request #22 from leapmotion/issue-20
Browse files Browse the repository at this point in the history
Correcting invalid linker flag for clang on other platforms
  • Loading branch information
gtremper committed Aug 1, 2014
2 parents 675e4e8 + 15bc960 commit f819a64
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 f819a64

Please sign in to comment.