mirror of
				https://github.com/TheLartians/ModernCppStarter.git
				synced 2025-10-31 10:11:34 +01:00 
			
		
		
		
	why manipulate target properies?
disable ccache be default but use -Wpendatic instead of -pedeantic
This commit is contained in:
		
							parent
							
								
									48ab4e707d
								
							
						
					
					
						commit
						0ec4474d42
					
				
					 4 changed files with 5 additions and 4 deletions
				
			
		|  | @ -41,7 +41,7 @@ CPMAddPackage( | ||||||
| # NOTE: If fmt is not imported, this is needed to prevent: | # NOTE: If fmt is not imported, this is needed to prevent: | ||||||
| #   CMake Error: install(EXPORT "GreeterTargets" ...) includes target | #   CMake Error: install(EXPORT "GreeterTargets" ...) includes target | ||||||
| #   "Greeter" which requires target "fmt" that is not in any export set. | #   "Greeter" which requires target "fmt" that is not in any export set. | ||||||
| option(FMT_INSTALL "" YES) | option(FMT_INSTALL "needed!" YES) | ||||||
| 
 | 
 | ||||||
| CPMAddPackage( | CPMAddPackage( | ||||||
|   NAME fmt |   NAME fmt | ||||||
|  |  | ||||||
|  | @ -67,7 +67,7 @@ if(USE_SANITIZER OR USE_STATIC_ANALYZER) | ||||||
| endif() | endif() | ||||||
| 
 | 
 | ||||||
| # enables CCACHE support through the USE_CCACHE flag possible values are: YES, NO or equivalent | # enables CCACHE support through the USE_CCACHE flag possible values are: YES, NO or equivalent | ||||||
| option(USE_CCACHE "enable ccache usages" ON) | option(USE_CCACHE "enable ccache usages" NO) | ||||||
| if(USE_CCACHE) | if(USE_CCACHE) | ||||||
|   CPMAddPackage( |   CPMAddPackage( | ||||||
|     NAME Ccache.cmake |     NAME Ccache.cmake | ||||||
|  |  | ||||||
|  | @ -26,7 +26,8 @@ file(GLOB sources CONFIGURE_DEPENDS source/*.cpp) | ||||||
| add_executable(GreeterStandalone ${sources}) | add_executable(GreeterStandalone ${sources}) | ||||||
| 
 | 
 | ||||||
| # FIXME: WHY? CK | # FIXME: WHY? CK | ||||||
| # set_target_properties(GreeterStandalone PROPERTIES CXX_STANDARD 17 OUTPUT_NAME "Greeter") | set_target_properties(GreeterStandalone OUTPUT_NAME "Greeter") | ||||||
|  | 
 | ||||||
| target_compile_features(GreeterStandalone PUBLIC cxx_std_17) | target_compile_features(GreeterStandalone PUBLIC cxx_std_17) | ||||||
| 
 | 
 | ||||||
| target_link_libraries(GreeterStandalone PRIVATE Greeter::Greeter cxxopts) | target_link_libraries(GreeterStandalone PRIVATE Greeter::Greeter cxxopts) | ||||||
|  |  | ||||||
|  | @ -45,7 +45,7 @@ target_compile_features(GreeterTests PUBLIC cxx_std_17) | ||||||
| # enable compiler warnings | # enable compiler warnings | ||||||
| if(NOT TEST_INSTALLED_VERSION) | if(NOT TEST_INSTALLED_VERSION) | ||||||
|   if(CMAKE_CXX_COMPILER_ID MATCHES "Clang" OR CMAKE_CXX_COMPILER_ID MATCHES "GNU") |   if(CMAKE_CXX_COMPILER_ID MATCHES "Clang" OR CMAKE_CXX_COMPILER_ID MATCHES "GNU") | ||||||
|     target_compile_options(Greeter PRIVATE -Wall -pedantic -Wextra -Werror) |     target_compile_options(Greeter PRIVATE -Wall -Wpedantic -Wextra -Werror) | ||||||
|   elseif(MSVC) |   elseif(MSVC) | ||||||
|     target_compile_options(Greeter PRIVATE /W4 /WX) |     target_compile_options(Greeter PRIVATE /W4 /WX) | ||||||
|     target_compile_definitions(GreeterTests PRIVATE DOCTEST_CONFIG_USE_STD_HEADERS) |     target_compile_definitions(GreeterTests PRIVATE DOCTEST_CONFIG_USE_STD_HEADERS) | ||||||
|  |  | ||||||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue