aboutsummaryrefslogtreecommitdiffstats
path: root/meta-oe/recipes-support/hdf5/files/0001-cross-compiling-support.patch
blob: bdc1fa5f96a8477c25e91f1316a877bbfc5b1a5a (plain)
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
From 1b4fadf550587b46e405d7ccb777dcb00aa791a2 Mon Sep 17 00:00:00 2001
From: Hongxu Jia <hongxu.jia@windriver.com>
Date: Tue, 29 Jan 2019 15:39:15 +0800
Subject: [PATCH 1/2] cross compiling support

Do not generate config files at build time, use pre-generated
files to instead.

Upstream-Status: Inappropriate [oe specific]

Signed-off-by: Hongxu Jia <hongxu.jia@windriver.com>
---
 CMakeLists.txt     |  6 ++++++
 src/CMakeLists.txt | 23 -----------------------
 2 files changed, 6 insertions(+), 23 deletions(-)

--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -770,4 +770,10 @@ endif ()
 #-----------------------------------------------------------------------------
 configure_file (${HDF_RESOURCES_DIR}/H5pubconf.h.in ${HDF5_BINARY_DIR}/H5pubconf.h @ONLY)
 
+#-----------------------------------------------------------------------------
+# Copy the pre-generated files in place
+#-----------------------------------------------------------------------------
+configure_file(H5Tinit.c H5Tinit.c COPYONLY)
+configure_file(H5lib_settings.c H5lib_settings.c COPYONLY)
+
 include (CMakeInstallation.cmake)
--- a/src/CMakeLists.txt
+++ b/src/CMakeLists.txt
@@ -613,36 +613,9 @@ set (H5_PRIVATE_HEADERS
 #-----------------------------------------------------------------------------
 add_executable (H5detect ${HDF5_SRC_DIR}/H5detect.c)
 TARGET_C_PROPERTIES (H5detect STATIC " " " ")
-if (MSVC OR MINGW)
-  target_link_libraries (H5detect "ws2_32.lib")
-endif ()
-if (CMAKE_SYSTEM_NAME STREQUAL "Emscripten")
-  set_property(TARGET H5detect PROPERTY LINK_FLAGS "-O0")
-endif ()
-
-add_custom_command (
-    OUTPUT ${HDF5_BINARY_DIR}/H5Tinit.c
-    COMMAND $<TARGET_FILE:H5detect>
-    ARGS > ${HDF5_BINARY_DIR}/H5Tinit.c
-    DEPENDS H5detect
-)
 
 add_executable (H5make_libsettings ${HDF5_SRC_DIR}/H5make_libsettings.c)
 TARGET_C_PROPERTIES (H5make_libsettings STATIC " " " ")
-if (MSVC OR MINGW)
-  target_link_libraries (H5make_libsettings "ws2_32.lib")
-endif ()
-if (CMAKE_SYSTEM_NAME STREQUAL "Emscripten")
-  set_property(TARGET H5make_libsettings PROPERTY LINK_FLAGS "-O0")
-endif ()
-
-add_custom_command (
-    OUTPUT ${HDF5_BINARY_DIR}/H5lib_settings.c
-    COMMAND $<TARGET_FILE:H5make_libsettings>
-    ARGS > ${HDF5_BINARY_DIR}/H5lib_settings.c
-    DEPENDS H5make_libsettings
-    WORKING_DIRECTORY ${HDF5_BINARY_DIR}
-)
 
 if (GENERATE_ERROR_HEADERS)
   find_package (Perl)