@@ -3,10 +3,6 @@ add_library (ChakraCore SHARED
3
3
ConfigParserExternals.cpp
4
4
TestHooks.cpp
5
5
)
6
-
7
- # By default, don't export any symbols from this library
8
- # We'll manually export the relevant individual functions
9
- set_target_properties (ChakraCore PROPERTIES CXX_VISIBILITY_PRESET hidden)
10
6
11
7
target_include_directories (
12
8
ChakraCore PUBLIC
@@ -32,42 +28,88 @@ target_include_directories (
32
28
# dl: For shared library loading related functions
33
29
# icuuc: For the ICU (xplat-todo: Make this optional)
34
30
#
35
- target_link_libraries (ChakraCore
36
- -Wl,--no -undefined
37
- -Wl,--start -group
38
- -Wl,--whole-archive
39
- Chakra.Jsrt
40
- Chakra.Jsrt.Core
41
- -Wl,--no -whole-archive
42
- Chakra.Runtime.Types
43
- Chakra.Runtime.Math
44
- Chakra.Runtime.Library
45
- Chakra.Runtime.Language
46
- Chakra.Runtime.Debug
47
- Chakra.Runtime.ByteCode
48
- Chakra.Runtime.PlatformAgnostic
49
- Chakra.Runtime.Base
50
- Chakra.Parser
51
- Chakra.Common.Util
52
- Chakra.Common.Memory
53
- Chakra.Common.Common
54
- Chakra.Common.Core
55
- Chakra.Common.DataStructures
56
- Chakra.Common.Exceptions
57
- Chakra.Common.Codex
58
- -Wl,--end -group
59
- Chakra.Pal
60
- pthread
61
- stdc++
62
- dl
63
- icuuc
64
- -Wl,--version -script=${CMAKE_CURRENT_SOURCE_DIR} /libChakraCoreLib.version
65
- )
31
+ if (CMAKE_SYSTEM_NAME STREQUAL Linux)
32
+ target_link_libraries (ChakraCore
33
+ -Wl,--no -undefined
34
+ -Wl,--start -group
35
+ -Wl,--whole-archive
36
+ Chakra.Jsrt
37
+ Chakra.Jsrt.Core
38
+ -Wl,--no -whole-archive
39
+ Chakra.Runtime.Types
40
+ Chakra.Runtime.Math
41
+ Chakra.Runtime.Library
42
+ Chakra.Runtime.Language
43
+ Chakra.Runtime.Debug
44
+ Chakra.Runtime.ByteCode
45
+ Chakra.Runtime.PlatformAgnostic
46
+ Chakra.Runtime.Base
47
+ Chakra.Parser
48
+ Chakra.Common.Util
49
+ Chakra.Common.Memory
50
+ Chakra.Common.Common
51
+ Chakra.Common.Core
52
+ Chakra.Common.DataStructures
53
+ Chakra.Common.Exceptions
54
+ Chakra.Common.Codex
55
+ -Wl,--end -group
56
+ Chakra.Pal
57
+ pthread
58
+ stdc++
59
+ dl
60
+ icuuc
61
+ -Wl,--version -script=${CMAKE_CURRENT_SOURCE_DIR} /libChakraCoreLib.version
62
+ )
63
+ #
64
+ # Post build step to copy the built shared library
65
+ # to BuildLinux (or whatever the CMakeBuildDir is)
66
+ add_custom_command (TARGET ChakraCore POST_BUILD
67
+ COMMAND ${CMAKE_COMMAND} -E copy_if_different
68
+ "${CHAKRACORE_BINARY_DIR} /bin/ChakraCore/libChakraCore.so"
69
+ ${CHAKRACORE_BINARY_DIR} /)
70
+ elseif (CMAKE_SYSTEM_NAME STREQUAL Darwin)
71
+ # todo: combine link libraries into a list
72
+ # reminder: order of the link libraries matters
73
+ # we miss multiple keywords below
74
+ # can we handle the creation of the list
75
+ # with a single IF/case per platform?
66
76
67
- #
68
- # Post build step to copy the built shared library
69
- # to BuildLinux (or whatever the CMakeBuildDir is)
70
- add_custom_command (TARGET ChakraCore POST_BUILD
71
- COMMAND ${CMAKE_COMMAND} -E copy_if_different
72
- "${CHAKRACORE_BINARY_DIR} /bin/ChakraCore/libChakraCore.so"
73
- ${CHAKRACORE_BINARY_DIR} /)
77
+ target_link_libraries (ChakraCore
78
+ -Wl,-undefined,error
79
+ # -Wl,--start-group
80
+ # -Wl,--whole-archive
81
+ Chakra.Jsrt
82
+ Chakra.Jsrt.Core
83
+ # -Wl,--no-whole-archive
84
+ Chakra.Runtime.Types
85
+ Chakra.Runtime.Math
86
+ Chakra.Runtime.Library
87
+ Chakra.Runtime.Language
88
+ Chakra.Runtime.Debug
89
+ Chakra.Runtime.ByteCode
90
+ Chakra.Runtime.PlatformAgnostic
91
+ Chakra.Runtime.Base
92
+ Chakra.Parser
93
+ Chakra.Common.Util
94
+ Chakra.Common.Memory
95
+ Chakra.Common.Common
96
+ Chakra.Common.Core
97
+ Chakra.Common.DataStructures
98
+ Chakra.Common.Exceptions
99
+ Chakra.Common.Codex
100
+ # -Wl,--end-group
101
+ Chakra.Pal
102
+ pthread
103
+ stdc++
104
+ dl
105
+ icucore
106
+ # -Wl,--version-script=${CMAKE_CURRENT_SOURCE_DIR}/libChakraCoreLib.version
107
+ )
108
+ #
109
+ # Post build step to copy the built shared library
110
+ # to BuildLinux (or whatever the CMakeBuildDir is)
111
+ add_custom_command (TARGET ChakraCore POST_BUILD
112
+ COMMAND ${CMAKE_COMMAND} -E copy_if_different
113
+ "${CHAKRACORE_BINARY_DIR} /bin/ChakraCore/libChakraCore.dylib"
114
+ ${CHAKRACORE_BINARY_DIR} /)
115
+ endif ()
0 commit comments