Adding IPO support.
This commit is contained in:
		
					parent
					
						
							
								cc623bcdeb
							
						
					
				
			
			
				commit
				
					
						882c48acb9
					
				
			
		
					 3 changed files with 18 additions and 1 deletions
				
			
		| 
						 | 
					@ -1,8 +1,10 @@
 | 
				
			||||||
cmake_minimum_required(VERSION 3.1)
 | 
					cmake_minimum_required(VERSION 3.18)
 | 
				
			||||||
project(qwt VERSION 6.1.3 LANGUAGES CXX)
 | 
					project(qwt VERSION 6.1.3 LANGUAGES CXX)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
option(WITH_EXAMPLES "Whether to include examples" OFF)
 | 
					option(WITH_EXAMPLES "Whether to include examples" OFF)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					include(CheckIPOSupported)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
add_subdirectory(src)
 | 
					add_subdirectory(src)
 | 
				
			||||||
add_subdirectory(textengines)
 | 
					add_subdirectory(textengines)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -221,6 +221,8 @@ set(qwt_sources
 | 
				
			||||||
#----------------------------------------------------------------
 | 
					#----------------------------------------------------------------
 | 
				
			||||||
# Target
 | 
					# Target
 | 
				
			||||||
#----------------------------------------------------------------
 | 
					#----------------------------------------------------------------
 | 
				
			||||||
 | 
					check_ipo_supported(RESULT result OUTPUT output)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
if(QWT_USE_STATIC_LIBS)
 | 
					if(QWT_USE_STATIC_LIBS)
 | 
				
			||||||
    add_library(qwt STATIC ${qwt_headers} ${qwt_sources})
 | 
					    add_library(qwt STATIC ${qwt_headers} ${qwt_sources})
 | 
				
			||||||
else()
 | 
					else()
 | 
				
			||||||
| 
						 | 
					@ -234,6 +236,13 @@ else()
 | 
				
			||||||
    )
 | 
					    )
 | 
				
			||||||
endif()
 | 
					endif()
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					check_ipo_supported(RESULT result OUTPUT output)
 | 
				
			||||||
 | 
					if(result)
 | 
				
			||||||
 | 
					    set_target_properties(qwt PROPERTIES INTERPROCEDURAL_OPTIMIZATION_RELEASE ON)
 | 
				
			||||||
 | 
					else()
 | 
				
			||||||
 | 
					    message(WARNING "IPO is not supported: ${output}")
 | 
				
			||||||
 | 
					endif()
 | 
				
			||||||
 | 
					
 | 
				
			||||||
target_include_directories(qwt
 | 
					target_include_directories(qwt
 | 
				
			||||||
	PUBLIC
 | 
						PUBLIC
 | 
				
			||||||
		${PROJECT_SOURCE_DIR}/include
 | 
							${PROJECT_SOURCE_DIR}/include
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -20,6 +20,12 @@ set(qwt_mathml_sources
 | 
				
			||||||
# Target
 | 
					# Target
 | 
				
			||||||
#----------------------------------------------------------------
 | 
					#----------------------------------------------------------------
 | 
				
			||||||
add_library(qwt_mathml SHARED ${qwt_mathml_headers} ${qwt_mathml_sources})
 | 
					add_library(qwt_mathml SHARED ${qwt_mathml_headers} ${qwt_mathml_sources})
 | 
				
			||||||
 | 
					check_ipo_supported(RESULT result OUTPUT output)
 | 
				
			||||||
 | 
					if(result)
 | 
				
			||||||
 | 
					    set_target_properties(qwt_mathml PROPERTIES INTERPROCEDURAL_OPTIMIZATION_RELEASE ON)
 | 
				
			||||||
 | 
					else()
 | 
				
			||||||
 | 
					    message(WARNING "IPO is not supported: ${output}")
 | 
				
			||||||
 | 
					endif()
 | 
				
			||||||
 | 
					
 | 
				
			||||||
target_include_directories(qwt_mathml
 | 
					target_include_directories(qwt_mathml
 | 
				
			||||||
	PUBLIC
 | 
						PUBLIC
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue