Allow brave/foolish souls to use internal private C API
@@ -36,6 +36,7 @@ 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)
# Setup
if(EMSCRIPTEN)
@@ -357,7 +358,9 @@ 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_STANDARD 99)
target_include_directories(lovr PRIVATE src src/modules src/lib/stdatomic)
target_link_libraries(lovr
