forked from msys2/MINGW-packages
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathf19edfa.diff
More file actions
89 lines (79 loc) · 3.36 KB
/
Copy pathf19edfa.diff
File metadata and controls
89 lines (79 loc) · 3.36 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
From f19edfa95f8dc9fa596282a210757e4d6d0cd490 Mon Sep 17 00:00:00 2001
From: Christopher Degawa <christopher.degawa@intel.com>
Date: Thu, 03 Jun 2021 18:05:47 -0500
Subject: [PATCH] exports.cmake: use APPLE and WIN32 and use def for mingw-w64
mingw-w64's ld and lld automatically accepts MSVC's def files and CMake
can handle the proper flags for .def files added to a library's sources.
This fixes the export file handling for mingw-w64 lld as that lld does
not support the --version-script argument
Signed-off-by: Christopher Degawa <christopher.degawa@intel.com>
Change-Id: I18a1ce2696e2f9b083ecab3d0d60566d48b68cf0
---
diff --git a/build/cmake/exports.cmake b/build/cmake/exports.cmake
index fa7842c..4f9d043 100644
--- a/build/cmake/exports.cmake
+++ b/build/cmake/exports.cmake
@@ -17,9 +17,9 @@
# Creates the custom target which handles generation of the symbol export lists.
function(setup_exports_target)
- if("${AOM_TARGET_SYSTEM}" STREQUAL "Darwin")
+ if(APPLE)
set(symbol_file_ext "syms")
- elseif("${AOM_TARGET_SYSTEM}" MATCHES "Windows\|MSYS" AND MSVC)
+ elseif(WIN32)
set(symbol_file_ext "def")
else()
set(symbol_file_ext "ver")
@@ -43,7 +43,7 @@
-P
"${AOM_ROOT}/build/cmake/generate_exports.cmake"
SOURCES ${AOM_EXPORTS_SOURCES}
- DEPENDS ${AOM_EXPORTS_SOURCES})
+ DEPENDS ${AOM_EXPORTS_SOURCES} BYPRODUCTS ${aom_sym_file})
# Make libaom depend on the exports file, and set flags to pick it up when
# creating the dylib.
@@ -54,14 +54,12 @@
APPEND_STRING
PROPERTY LINK_FLAGS "-exported_symbols_list ${aom_sym_file}")
elseif(WIN32)
- if(NOT MSVC)
- set_property(TARGET aom
- APPEND_STRING
- PROPERTY LINK_FLAGS "-Wl,--version-script ${aom_sym_file}")
- else()
+ if(MSVC)
set_property(TARGET aom
APPEND_STRING
PROPERTY LINK_FLAGS "/DEF:${aom_sym_file}")
+ else()
+ target_sources(aom PRIVATE "${aom_sym_file}")
endif()
# TODO(tomfinegan): Sort out the import lib situation and flags for MSVC.
diff --git a/build/cmake/generate_exports.cmake b/build/cmake/generate_exports.cmake
index f1d15a0..8720ac8 100644
--- a/build/cmake/generate_exports.cmake
+++ b/build/cmake/generate_exports.cmake
@@ -23,7 +23,7 @@
if("${AOM_TARGET_SYSTEM}" STREQUAL "Darwin")
set(symbol_prefix "_")
-elseif("${AOM_TARGET_SYSTEM}" MATCHES "Windows\|MSYS" AND AOM_MSVC)
+elseif("${AOM_TARGET_SYSTEM}" MATCHES "Windows\|MSYS")
file(WRITE "${AOM_SYM_FILE}" "LIBRARY aom\n" "EXPORTS\n")
else()
set(symbol_suffix ";")
@@ -33,7 +33,7 @@
if("${AOM_TARGET_SYSTEM}" STREQUAL "Darwin")
file(REMOVE "${aom_sym_file}")
-elseif("${AOM_TARGET_SYSTEM}" MATCHES "Windows\|MSYS" AND AOM_MSVC)
+elseif("${AOM_TARGET_SYSTEM}" MATCHES "Windows\|MSYS")
file(WRITE "${aom_sym_file}" "LIBRARY aom\n" "EXPORTS\n")
else()
file(WRITE "${aom_sym_file}" "{\nglobal:\n")
@@ -47,7 +47,7 @@
foreach(exported_symbol ${exported_symbols})
string(STRIP "${exported_symbol}" exported_symbol)
- if("${AOM_TARGET_SYSTEM}" MATCHES "Windows\|MSYS" AND AOM_MSVC)
+ if("${AOM_TARGET_SYSTEM}" MATCHES "Windows\|MSYS")
string(SUBSTRING ${exported_symbol} 0 4 export_type)
string(COMPARE EQUAL "${export_type}" "data" is_data)
if(is_data)