Skip to content

Commit

Permalink
Update to only export LIBRARY_EXPORT symbols from the shared library (n…
Browse files Browse the repository at this point in the history
…i#362)

Signed-off-by: Yanjiang Qian <yanjiang.qian@ni.com>
  • Loading branch information
yaqian256 authored Jun 12, 2024
1 parent d45c511 commit add68a6
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 1 deletion.
2 changes: 2 additions & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,8 @@ project(labview-grpc C CXX)

if(NOT MSVC)
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++14")
# Set default visibility to hidden, only export LIBRARY_EXPORT symbols from the shared library
add_compile_options(-fvisibility=hidden)
else()
add_definitions(-D_WIN32_WINNT=0x600)
set(CMAKE_MSVC_RUNTIME_LIBRARY "MultiThreaded$<$<CONFIG:Debug>:Debug>")
Expand Down
2 changes: 1 addition & 1 deletion src/lv_interop.h
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
#ifdef _WIN32
#define LIBRARY_EXPORT extern "C" __declspec(dllexport)
#else
#define LIBRARY_EXPORT extern "C"
#define LIBRARY_EXPORT extern "C" __attribute__((visibility("default")))
#endif

namespace grpc_labview
Expand Down

0 comments on commit add68a6

Please sign in to comment.