1
0
Fork 0

Fix target_link_options_if_exists

This commit is contained in:
Ilya Fedin 2023-11-03 07:24:56 +04:00 committed by John Preston
parent 60474a5766
commit 78098ede77

View file

@ -4,7 +4,7 @@
# For license and copyright information please follow this link: # For license and copyright information please follow this link:
# https://github.com/desktop-app/legal/blob/master/LEGAL # https://github.com/desktop-app/legal/blob/master/LEGAL
include(CheckCXXCompilerFlag) include(CheckLinkerFlag)
function(target_link_options_if_exists target_name) function(target_link_options_if_exists target_name)
set(writing_now "") set(writing_now "")
@ -16,7 +16,7 @@ function(target_link_options_if_exists target_name)
set(writing_now ${entry}) set(writing_now ${entry})
else() else()
string(MAKE_C_IDENTIFIER ${entry} entry_identifier) string(MAKE_C_IDENTIFIER ${entry} entry_identifier)
check_cxx_compiler_flag(${entry} DESKTOP_APP_${entry_identifier}_EXISTS) check_linker_flag(CXX ${entry} DESKTOP_APP_${entry_identifier}_EXISTS)
if (DESKTOP_APP_${entry_identifier}_EXISTS) if (DESKTOP_APP_${entry_identifier}_EXISTS)
if ("${writing_now}" STREQUAL "PRIVATE") if ("${writing_now}" STREQUAL "PRIVATE")
list(APPEND private_options ${entry}) list(APPEND private_options ${entry})