Skip to content

Commit

Permalink
maybe this
Browse files Browse the repository at this point in the history
  • Loading branch information
K20shores committed Mar 12, 2024
1 parent 3de8471 commit 27f402a
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 7 deletions.
10 changes: 10 additions & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,16 @@ elseif(${CMAKE_Fortran_COMPILER_ID} MATCHES "PGI")
add_definitions(-DMUSICA_USING_PGI)
endif()

if(MUSICA_BUILD_C_CXX_INTERFACE)
# on ubuntu with clang, an incorrect version of the c++ standard library was being linked
if (${CMAKE_HOST_SYSTEM_NAME} MATCHES "Linux" AND "${CMAKE_CXX_COMPILER_ID}" STREQUAL "Clang")
# If the compiler is Clang, use libc++
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -stdlib=libc++")
endif()

set(CMAKE_CXX_STANDARD 20)
endif()

################################################################################
# Dependencies

Expand Down
1 change: 0 additions & 1 deletion cmake/dependencies.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@ endif()
################################################################################
# google test
if(MUSICA_ENABLE_TESTS)
set(CMAKE_CXX_STANDARD 20)
include(FetchContent)
FetchContent_Declare(googletest
GIT_REPOSITORY https://github.com/google/googletest.git
Expand Down
6 changes: 0 additions & 6 deletions src/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -14,12 +14,6 @@ include(musica_util)
# Add submodules
checkout_submodules()

# on ubuntu with clang, an incorrect version of the c++ standard library was being linked
if (${CMAKE_HOST_SYSTEM_NAME} MATCHES "Linux" AND "${CMAKE_CXX_COMPILER_ID}" STREQUAL "Clang")
# If the compiler is Clang, use libc++
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -stdlib=libc++")
endif()

##############################################################################
# MUSICA targets

Expand Down

0 comments on commit 27f402a

Please sign in to comment.