vcpkg/ports/wxwidgets/fix-linux-configure.patch
Jack·Boos·Yu c2960201e3
[wxwidgets] Fix linux build (#23765)
* [wxwidgets] Fix linux build

* clean up baseline

* version

* Fix --libs output

* version

* Use system pkg-config on linux (#6)

* Use system pkg-config for linux

* Update versions

* Revert baseline changes

* Add double quotes to paths

* version

* Fix incorrect double quotes place

* version

Co-authored-by: Kai Pastor <dg0yt@darc.de>
2022-03-31 11:11:30 -07:00

50 lines
2.3 KiB
Diff

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
+ "<COMPILE_LANG_AND_ID:CUDA,NVIDIA>" "<COMPILE_LANGUAGE:CUDA>"
+ 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 $<$<CONFIG:DEBUG>:LIB_PATH>
+ # Or $<$<NOT:$<CONFIG:DEBUG>>: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()