mirror of https://github.com/bjornbytes/lovr.git
LÖVR submodule improvements;
- Allow parent CMake projects to expose symbols more easily - Allow for custom plugins folder - Include directories are always relative to lovr's source dir Co-authored-by: Ilya Chelyadin <ilya77105@gmail.com>
This commit is contained in:
parent
cacc5eae71
commit
7d3cc45cc2
|
@ -34,8 +34,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_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_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_BUNDLE "On macOS, build a .app bundle instead of a raw program" OFF)
|
||||||
|
option(LOVR_BUILD_WITH_SYMBOLS "Build with C function symbols exposed" 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
|
# Setup
|
||||||
if(EMSCRIPTEN)
|
if(EMSCRIPTEN)
|
||||||
|
@ -299,7 +298,9 @@ endif()
|
||||||
# Plugins
|
# Plugins
|
||||||
set(LOVR 1)
|
set(LOVR 1)
|
||||||
link_libraries(${LOVR_LUA})
|
link_libraries(${LOVR_LUA})
|
||||||
file(GLOB LOVR_PLUGINS ${CMAKE_SOURCE_DIR}/plugins/*)
|
if(NOT DEFINED LOVR_PLUGINS)
|
||||||
|
file(GLOB LOVR_PLUGINS ${CMAKE_SOURCE_DIR}/plugins/*)
|
||||||
|
endif()
|
||||||
foreach(PLUGIN_PATH ${LOVR_PLUGINS})
|
foreach(PLUGIN_PATH ${LOVR_PLUGINS})
|
||||||
if(IS_DIRECTORY ${PLUGIN_PATH} AND EXISTS ${PLUGIN_PATH}/CMakeLists.txt)
|
if(IS_DIRECTORY ${PLUGIN_PATH} AND EXISTS ${PLUGIN_PATH}/CMakeLists.txt)
|
||||||
get_filename_component(PLUGIN "${PLUGIN_PATH}" NAME)
|
get_filename_component(PLUGIN "${PLUGIN_PATH}" NAME)
|
||||||
|
@ -338,10 +339,22 @@ if(NOT LOVR_BUILD_EXE)
|
||||||
target_compile_definitions(lovr PUBLIC LOVR_OMIT_MAIN) # specifically for win32 WinMain
|
target_compile_definitions(lovr PUBLIC LOVR_OMIT_MAIN) # specifically for win32 WinMain
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
set_target_properties(lovr PROPERTIES C_VISIBILITY_PRESET ${LOVR_SYMBOL_VISIBILITY})
|
if(LOVR_BUILD_WITH_SYMBOLS)
|
||||||
|
set_target_properties(lovr PROPERTIES C_VISIBILITY_PRESET "default")
|
||||||
|
else()
|
||||||
|
set_target_properties(lovr PROPERTIES C_VISIBILITY_PRESET "hidden")
|
||||||
|
endif()
|
||||||
|
|
||||||
set_target_properties(lovr PROPERTIES C_STANDARD 11)
|
set_target_properties(lovr PROPERTIES C_STANDARD 11)
|
||||||
set_target_properties(lovr PROPERTIES C_STANDARD_REQUIRED ON)
|
set_target_properties(lovr PROPERTIES C_STANDARD_REQUIRED ON)
|
||||||
target_include_directories(lovr PRIVATE src src/modules src/lib/stdatomic etc)
|
|
||||||
|
target_include_directories(lovr PRIVATE
|
||||||
|
${CMAKE_CURRENT_SOURCE_DIR}/src
|
||||||
|
${CMAKE_CURRENT_SOURCE_DIR}/src/modules
|
||||||
|
${CMAKE_CURRENT_SOURCE_DIR}/src/lib/stdatomic
|
||||||
|
${CMAKE_CURRENT_SOURCE_DIR}/etc
|
||||||
|
)
|
||||||
|
|
||||||
target_link_libraries(lovr
|
target_link_libraries(lovr
|
||||||
${LOVR_GLFW}
|
${LOVR_GLFW}
|
||||||
${LOVR_LUA}
|
${LOVR_LUA}
|
||||||
|
|
|
@ -2,6 +2,8 @@
|
||||||
#include <stdint.h>
|
#include <stdint.h>
|
||||||
#include <stddef.h>
|
#include <stddef.h>
|
||||||
|
|
||||||
|
#pragma once
|
||||||
|
|
||||||
typedef struct gpu_buffer gpu_buffer;
|
typedef struct gpu_buffer gpu_buffer;
|
||||||
typedef struct gpu_texture gpu_texture;
|
typedef struct gpu_texture gpu_texture;
|
||||||
typedef struct gpu_sampler gpu_sampler;
|
typedef struct gpu_sampler gpu_sampler;
|
||||||
|
|
Loading…
Reference in New Issue