mirror of
				https://github.com/PurpleI2P/i2pd.git
				synced 2025-11-04 08:30:46 +00:00 
			
		
		
		
	cmake: add stdlib args for clang build on Linux
Otherwise linking fails with undefined symbol ... basic_string ... and libstdc++: DSO not on included in link command.
This commit is contained in:
		
							parent
							
								
									fa9c39732d
								
							
						
					
					
						commit
						291f28fcce
					
				
					 1 changed files with 9 additions and 0 deletions
				
			
		| 
						 | 
				
			
			@ -178,6 +178,9 @@ if (CMAKE_CXX_COMPILER_ID STREQUAL "GNU")
 | 
			
		|||
  endif ()
 | 
			
		||||
elseif (CMAKE_CXX_COMPILER_ID STREQUAL "Clang")
 | 
			
		||||
  # more tweaks
 | 
			
		||||
  if (NOT (MSVC OR MSYS OR APPLE))
 | 
			
		||||
    set (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -stdlib=libstdc++" )
 | 
			
		||||
  endif()
 | 
			
		||||
endif ()
 | 
			
		||||
 | 
			
		||||
if (WITH_HARDENING AND MSVC)
 | 
			
		||||
| 
						 | 
				
			
			@ -457,6 +460,12 @@ if (WITH_BINARY)
 | 
			
		|||
      fixup_bundle(\"${APPS}\"   \"\"   \"${DIRS}\")
 | 
			
		||||
      " COMPONENT Runtime)
 | 
			
		||||
  endif ()
 | 
			
		||||
 | 
			
		||||
  if (CMAKE_CXX_COMPILER_ID STREQUAL "Clang")
 | 
			
		||||
    if (NOT (MSVC OR MSYS OR APPLE)) # for Clang build on Linux
 | 
			
		||||
      target_link_libraries("${PROJECT_NAME}" stdc++)
 | 
			
		||||
    endif()
 | 
			
		||||
  endif()
 | 
			
		||||
endif ()
 | 
			
		||||
 | 
			
		||||
install(FILES ../LICENSE
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue