CMake refactoring to functions
This commit is contained in:
		@@ -21,13 +21,22 @@ enable_testing()
 | 
			
		||||
# The compiled library tests
 | 
			
		||||
if(SPDLOG_BUILD_TESTS)
 | 
			
		||||
    add_executable(spdlog-utests ${SPDLOG_UTESTS_SOURCES})
 | 
			
		||||
	spdlog_enable_warnings(spdlog-utests)
 | 
			
		||||
    target_link_libraries(spdlog-utests spdlog)
 | 
			
		||||
    add_test(NAME spdlog-utests COMMAND spdlog-utests)
 | 
			
		||||
	if(SPDLOG_SANITIZE_ADDRESS)
 | 
			
		||||
		spdlog_enable_sanitizer(spdlog-utests)
 | 
			
		||||
	endif()
 | 
			
		||||
    add_test(NAME spdlog-utests COMMAND spdlog-utests)	
 | 
			
		||||
	
 | 
			
		||||
endif()
 | 
			
		||||
 | 
			
		||||
# The header-only library version tests
 | 
			
		||||
if(SPDLOG_BUILD_HO_TESTS)
 | 
			
		||||
    add_executable(spdlog-utests-ho ${SPDLOG_UTESTS_SOURCES})
 | 
			
		||||
	spdlog_enable_warnings(spdlog-utests-ho)
 | 
			
		||||
    target_link_libraries(spdlog-utests-ho spdlog::spdlog_header_only)
 | 
			
		||||
	if(SPDLOG_SANITIZE_ADDRESS)
 | 
			
		||||
		spdlog_set_address_sanitizer(spdlog-utests-ho)
 | 
			
		||||
	endif()
 | 
			
		||||
    add_test(NAME spdlog-utests-ho COMMAND spdlog-utests-ho)
 | 
			
		||||
endif()
 | 
			
		||||
		Reference in New Issue
	
	Block a user