Skip to content
Snippets Groups Projects
os.cmake 745 B
Newer Older
  • Learn to ignore specific revisions
  • Whitney Armstrong's avatar
    Whitney Armstrong committed
    ## Get rid of rpath warning on OSX/MacOS
    
    Whitney Armstrong's avatar
    Whitney Armstrong committed
    if(${CMAKE_SYSTEM_NAME} MATCHES "Darwin")
    
    Whitney Armstrong's avatar
    Whitney Armstrong committed
      set(CMAKE_MACOSX_RPATH 1)
    
    else()
      set(BUILD_SHARED_LIBS 1)
    
    Whitney Armstrong's avatar
    Whitney Armstrong committed
    endif()
    
    
    Whitney Armstrong's avatar
    Whitney Armstrong committed
    ## Ensure the correct library for the "experimental" filesystem features is
    ## loaded: 
    ##    * Linux: libstdc++fs
    ##    * MacOS (XCode) for some reason still doesn't include the filesystem
    ##      features (this might change in XCode 10.0). Currently, a good way to get
    ##      them is by installing llvm directly through homebrew. The correct
    ##      library will then be:
    ##      /usr/local/opt/lib/libc++experimental.a
    
    Whitney Armstrong's avatar
    Whitney Armstrong committed
    if(${CMAKE_SYSTEM_NAME} MATCHES "Darwin")
    
    Whitney Armstrong's avatar
    Whitney Armstrong committed
      set(CXX_FILESYSTEM_LIB "/usr/local/opt/llvm/lib/libc++experimental.a")
    else()
      set(CXX_FILESYSTEM_LIB "stdc++fs")
    
    Whitney Armstrong's avatar
    Whitney Armstrong committed
    endif()