diff --git a/build/cmake/modules/cotire.cmake b/build/cmake/modules/cotire.cmake index bb69643..09b52a6 100644 --- a/build/cmake/modules/cotire.cmake +++ b/build/cmake/modules/cotire.cmake @@ -2316,6 +2316,10 @@ function (cotire_generate_target_script _language _configurations _target _targe "${_config}" "${_language}" "${_target}" COTIRE_TARGET_COMPILE_DEFINITIONS_${_upperConfig}) cotire_get_target_compiler_flags( "${_config}" "${_language}" "${_target}" COTIRE_TARGET_COMPILE_FLAGS_${_upperConfig}) + string(REPLACE + "" "" + COTIRE_TARGET_COMPILE_FLAGS_${_upperConfig} "${COTIRE_TARGET_COMPILE_FLAGS_${_upperConfig}}" + ) cotire_get_source_files_compile_definitions( "${_config}" "${_language}" COTIRE_TARGET_SOURCES_COMPILE_DEFINITIONS_${_upperConfig} ${_targetSources}) endforeach() diff --git a/build/cmake/config.cmake b/build/cmake/config.cmake index 91d11ac..2791466 100644 --- a/build/cmake/config.cmake +++ b/build/cmake/config.cmake @@ -41,9 +41,27 @@ macro(wx_get_dependencies var lib) endif() set(dep_name "-l${dep_name}") else() - get_filename_component(dep_name ${dep} NAME) + # For the value like $<$:LIB_PATH> + # Or $<$>:LIB_PATH> + string(REGEX REPLACE "^.+>:(.+)>$" "\\1" dep_name ${dep}) + if (NOT dep_name) + set(dep_name ${dep}) + endif() + endif() + if(dep_name STREQUAL "libc.so") + # don't include this library + elseif(dep_name MATCHES "^-(.*)$") # -l, -framework, -weak_framework + wx_string_append(${var} "${dep_name} ") + elseif(dep_name MATCHES "^lib(.*)(.so|.dylib|.tbd|.a)$") + wx_string_append(${var} "-l${CMAKE_MATCH_1} ") + elseif(dep_name) + get_filename_component(abs_path ${dep_name} PATH) + if (abs_path) # value contains path + wx_string_append(${var} "${dep_name} ") + else() + wx_string_append(${var} "-l${dep_name} ") + endif() endif() - wx_string_append(${var} "${dep_name} ") endforeach() string(STRIP ${${var}} ${var}) endif()