LOVR_BUILD_WITH_EXPORTED_INTERNALS --> LOVR_SYMBOL_VISIBILITY

This commit is contained in:
Nevyn Bengtsson 2021-04-28 10:38:06 +02:00 committed by Bjorn
parent 7b70fac0bb
commit 88de9a41af
1 changed files with 3 additions and 4 deletions

View File

@ -36,7 +36,8 @@ option(LOVR_SYSTEM_OPENXR "Use the system-provided OpenXR" OFF)
option(LOVR_BUILD_EXE "Build an executable (or an apk on Android)" ON)
option(LOVR_BUILD_SHARED "Build a shared library (takes precedence over LOVR_BUILD_EXE)" OFF)
option(LOVR_BUILD_BUNDLE "On macOS, build a .app bundle instead of a raw program" OFF)
option(LOVR_BUILD_WITH_EXPORTED_INTERNALS "When building as a shared library, make all C symbols visible. This exposes internals, so be aware that any APIs you use from C may change at any time." OFF)
set(LOVR_SYMBOL_VISIBILITY "hidden" CACHE STRING "What should the C symbol visibility be? hidden reduces binary size, default lets other binaries use this one.")
# Setup
if(EMSCRIPTEN)
@ -360,9 +361,7 @@ else()
return()
endif()
if(NOT LOVR_BUILD_WITH_EXPORTED_INTERNALS)
set_target_properties(lovr PROPERTIES C_VISIBILITY_PRESET hidden)
endif()
set_target_properties(lovr PROPERTIES C_VISIBILITY_PRESET ${LOVR_SYMBOL_VISIBILITY})
set_target_properties(lovr PROPERTIES C_STANDARD 99)
target_include_directories(lovr PRIVATE src src/modules src/lib/stdatomic)
target_link_libraries(lovr