Browse code

updated for newer mulle-c-developer

Nat! authored on 22-03-2018 00:25:28
Showing 9 changed files
... ...
@@ -1,4 +1,8 @@
1 1
 
2
+otool
3
+install_name_tool
4
+xcrun
5
+xcodebuild
2 6
 cc
3 7
 gcc
4 8
 ld
... ...
@@ -5,7 +5,7 @@ export MULLE_SDE_UPDATE_CALLBACKS="source,sourcetree"
5 5
 #
6 6
 #
7 7
 #
8
-export MULLE_SDE_INSTALLED_VERSION="0.14.1"
8
+export MULLE_SDE_INSTALLED_VERSION="0.14.2"
9 9
 
10 10
 
11 11
 #
12 12
new file mode 100644
... ...
@@ -0,0 +1,2 @@
1
+
2
+src/**/*[-_]standalone.c
0 3
deleted file mode 100644
... ...
@@ -1 +0,0 @@
1
-src/**/*[-_]standalone.c
2 0
\ No newline at end of file
... ...
@@ -1 +1 @@
1
-0.14.1
1
+0.14.2
... ...
@@ -54,11 +54,27 @@ endif()
54 54
 
55 55
 include( PostLibrary OPTIONAL)
56 56
 
57
+
58
+set( STANDALONE_BASE_NAME "mulle-concurrent")
59
+set( STANDALONE_NAME "mulle-concurrent-standalone")
60
+set( STANDALONE_DEFINITIONS ${MULLE_CONCURRENT_DEFINITIONS})
61
+set( STANDALONE_DEPENDENCIES
62
+mulle-concurrent
63
+)
64
+
65
+set( STANDALONE_ALL_LOAD_LIBRARIES
66
+$<TARGET_FILE:mulle-concurrent>
67
+${C_DEPENDENCY_LIBRARIES}
68
+${OS_SPECIFIC_LIBRARIES}
69
+)
70
+
71
+include( Standalone)
72
+
57 73
 ### Install
58 74
 
59 75
 include( PreInstall OPTIONAL)
60 76
 
61
-install( TARGETS "mulle-concurrent" DESTINATION "lib")
77
+install( TARGETS "mulle-concurrent" "mulle-concurrent-standalone" DESTINATION "lib")
62 78
 install( FILES ${PUBLIC_HEADERS}  DESTINATION "include/mulle-concurrent")
63 79
 install( FILES ${PRIVATE_HEADERS} DESTINATION "include/mulle-concurrent/private")
64 80
 
... ...
@@ -18,4 +18,4 @@ if( CREATE_MOTD_EXE)
18 18
    )
19 19
 
20 20
    add_dependencies( __motd__ ${PROJECT_NAME})
21
-endif()
22 21
\ No newline at end of file
22
+endif()
... ...
@@ -1,4 +1,8 @@
1
-# Files for cross-platform C development
1
+# DO NOT EDIT THIS FOLDER
2 2
 
3
-A bunch of stuff, that always comes up, when doing projects for multiple
4
-platforms, has been collected here.
3
+If you want to edit any of the files copy them "up" and edit them there.
4
+
5
+```
6
+cp share/Environment.cmake .
7
+vi Environment.cmake
8
+```
5 9
new file mode 100644
... ...
@@ -0,0 +1,138 @@
1
+#
2
+# A standalone library is a combination of multiple static libraries into
3
+# one shared library. Due to deficiencies in cmake on windows it is necessary
4
+# to have at lease one extra .c or .m file in the standalone library
5
+# defined in STANDALONE_SOURCES.
6
+#
7
+
8
+#
9
+# Input:
10
+#
11
+# STANDALONE_BASE_NAME
12
+# STANDALONE_ALL_LOAD_LIBRARIES
13
+# STANDALONE_SOURCES
14
+#
15
+# Optional:
16
+#
17
+# STANDALONE_NAME
18
+# STANDALONE_DEFINITIONS
19
+# STANDALONE_SYMBOL_PREFIXES
20
+# STANDALONE_NORMAL_LOAD_LIBRARIES
21
+# MULLE_LANGUAGE
22
+#
23
+set( STANDALONE_VERSION 3)
24
+
25
+#
26
+# If the main library is built as a shared library, we can't do it
27
+#
28
+if( NOT BUILD_SHARED_LIBS)
29
+   if( NOT STANDALONE_NAME)
30
+      set( STANDALONE_NAME "${STANDALONE_BASE_NAME}Standalone")
31
+   endif()
32
+
33
+   #
34
+   # Check for required standalone source file
35
+   #
36
+   if( NOT STANDALONE_SOURCES)
37
+      message( FATAL_ERROR "You need to define STANDALONE_SOURCES. Add a file
38
+   with contents like this:
39
+   int  ___mulle_concurrent_unused__;
40
+   and everybody will be happy")
41
+   endif()
42
+
43
+   #
44
+   # symbol prefixes to export on Windows, ignored on other platforms
45
+   #
46
+   if( NOT STANDALONE_SYMBOL_PREFIXES)
47
+      set( STANDALONE_SYMBOL_PREFIXES "mulle"
48
+              "_mulle"
49
+      )
50
+
51
+     if( "${MULLE_LANGUAGE}" MATCHES "ObjC")
52
+         set( STANDALONE_SYMBOL_PREFIXES
53
+            ${STANDALONE_SYMBOL_PREFIXES}
54
+            "Mulle"
55
+            "ns"
56
+            "NS"
57
+            "_Mulle"
58
+            "_ns"
59
+            "_NS"
60
+         )
61
+     endif()
62
+   endif()
63
+
64
+
65
+   #
66
+   # Make sure static libraries aren't optimized away
67
+   #
68
+   foreach( library ${STANDALONE_ALL_LOAD_LIBRARIES})
69
+      list( APPEND STANDALONE_FORCE_ALL_LOAD_LIBRARIES "${FORCE_LOAD_PREFIX}${library}")
70
+   endforeach()
71
+
72
+   foreach( prefix ${STANDALONE_SYMBOL_PREFIXES})
73
+      list( APPEND STANDALONE_DUMPDEF_SYMBOL_PREFIXES "--prefix")
74
+      list( APPEND STANDALONE_DUMPDEF_SYMBOL_PREFIXES "${prefix}")
75
+   endforeach()
76
+
77
+   #
78
+   # On Windows we need to rexport symbols using a .def file
79
+   #
80
+   if( MSVC)
81
+      set( DEF_FILE "${STANDALONE_NAME}.def")
82
+      set_source_files_properties( ${DEF_FILE} PROPERTIES HEADER_FILE_ONLY TRUE)
83
+      set( CMAKE_WINDOWS_EXPORT_ALL_SYMBOLS OFF)
84
+      set( CMAKE_SHARED_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS} /DEF:${DEF_FILE}")
85
+
86
+      message( STATUS "MSVC will generate \"${DEF_FILE}\" from ${TARGET_ALL_LOAD_LIBRARIES}")
87
+
88
+      add_custom_command( OUTPUT ${DEF_FILE}
89
+                          COMMAND mulle-mingw-dumpdef.bat -o "${DEF_FILE}"
90
+                                  --directory "${BUILD_RELATIVE_DEPENDENCIES_DIR}/lib"
91
+                                  ${STANDALONE_DUMPDEF_SYMBOL_PREFIXES}
92
+                                  ${STANDALONE_ALL_LOAD_LIBRARIES}
93
+                          DEPENDS ${STANDALONE_ALL_LOAD_LIBRARIES}
94
+                          VERBATIM)
95
+   endif()
96
+
97
+
98
+   #
99
+   # if STANDALONE_SOURCE is not defined, cmake on windows "forgets" to produce
100
+   # the DEF_FILE.
101
+   #
102
+   # Also you get tedious linker warnings on other platforms. Creating the
103
+   # STANDALONE_SOURCES on the fly, is just not worth it IMO.
104
+   #
105
+   add_library( ${STANDALONE_NAME} SHARED
106
+      ${STANDALONE_SOURCES}
107
+      ${DEF_FILE}
108
+   )
109
+
110
+   if( NOT STANDALONE_DEPENDENCIES)
111
+      set( STANDALONE_DEPENDENCIES
112
+         ${STANDALONE_BASE_NAME}
113
+         ${STANDALONE_STARTUP}
114
+      )
115
+   endif()
116
+
117
+   add_dependencies( ${STANDALONE_NAME} ${STANDALONE_DEPENDENCIES})
118
+
119
+   # If STANDALONE_SOURCES were to be empty, this would be needed
120
+   # set_target_properties( ${STANDALONE_NAME} PROPERTIES LINKER_LANGUAGE "C")
121
+
122
+   # PRIVATE is a guess
123
+   target_compile_definitions( ${STANDALONE_NAME} PRIVATE ${STANDALONE_DEFINITIONS})
124
+
125
+   #
126
+   # If you add DEPENDENCY_LIBRARIES to the static, adding them again to
127
+   # MulleObjCStandardFoundationStandalone confuses cmake it seems. But they are
128
+   # implicitly added.
129
+   #
130
+   target_link_libraries( ${STANDALONE_NAME}
131
+      ${BEGIN_ALL_LOAD}
132
+      ${STANDALONE_FORCE_ALL_LOAD_LIBRARIES}
133
+      ${END_ALL_LOAD}
134
+      ${STANDALONE_NORMAL_LOAD_LIBRARIES}
135
+   )
136
+else()
137
+   message( WARNING "Standalone can not be built with BUILD_SHARED_LIBS set to ON")
138
+endif()