Skip to content

Commit e9cc873

Browse files
authored
Restore cmake hidden compile symbol visibility (#3796)
This was originally fixed in #3655, but regressed in #3762 which removed the `-fvisibility=hidden` flag from the CMakeLists.txt file. This also removes extraneous ending whitespace from the file.
1 parent 79e695e commit e9cc873

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

CMakeLists.txt

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -124,7 +124,8 @@ include (${WAMR_ROOT_DIR}/build-scripts/runtime_lib.cmake)
124124
if (NOT WIN32)
125125
set (CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Wall -Wextra -Wformat -Wformat-security \
126126
-ffunction-sections -fdata-sections \
127-
-Wno-unused-parameter -Wno-pedantic")
127+
-Wno-unused-parameter -Wno-pedantic \
128+
-fvisibility=hidden")
128129
# Remove the extra spaces for better make log
129130
string (REGEX REPLACE " *" " " CMAKE_C_FLAGS ${CMAKE_C_FLAGS})
130131
set (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wall -Wextra -Wformat -Wformat-security -Wno-unused")
@@ -168,7 +169,7 @@ if (WAMR_BUILD_STATIC)
168169
endif ()
169170

170171
if (WIN32)
171-
target_link_libraries(iwasm_static PRIVATE ntdll)
172+
target_link_libraries(iwasm_static PRIVATE ntdll)
172173
endif()
173174

174175
install (TARGETS iwasm_static ARCHIVE DESTINATION lib)
@@ -190,7 +191,7 @@ if (WAMR_BUILD_SHARED)
190191
endif ()
191192

192193
if (WIN32)
193-
target_link_libraries(iwasm_shared PRIVATE ntdll)
194+
target_link_libraries(iwasm_shared PRIVATE ntdll)
194195
endif()
195196

196197
install (TARGETS iwasm_shared LIBRARY DESTINATION lib)

0 commit comments

Comments
 (0)