[CMake] Properly remove raudio.c and rmodels.c if they're disabled modules (#5878)
* only build raudio.c in cmake if it's still enabled * only compile rmodels if it's supported
This commit is contained in:
parent
e7edb181dc
commit
186d3ce9fb
|
|
@ -30,14 +30,22 @@ set(raylib_public_headers
|
||||||
|
|
||||||
# Sources to be compiled
|
# Sources to be compiled
|
||||||
set(raylib_sources
|
set(raylib_sources
|
||||||
raudio.c
|
|
||||||
rcore.c
|
rcore.c
|
||||||
rmodels.c
|
|
||||||
rshapes.c
|
rshapes.c
|
||||||
rtext.c
|
rtext.c
|
||||||
rtextures.c
|
rtextures.c
|
||||||
)
|
)
|
||||||
|
|
||||||
|
# Only build raudio if it's enabled
|
||||||
|
if (NOT DEFINED SUPPORT_MODULE_RAUDIO OR SUPPORT_MODULE_RAUDIO)
|
||||||
|
list(APPEND raylib_sources raudio.c)
|
||||||
|
endif()
|
||||||
|
|
||||||
|
# Only build rmodels if it's enabled
|
||||||
|
if (NOT DEFINED SUPPORT_MODULE_RMODELS OR SUPPORT_MODULE_RMODELS)
|
||||||
|
list(APPEND raylib_sources rmodels.c)
|
||||||
|
endif()
|
||||||
|
|
||||||
# <root>/cmake/GlfwImport.cmake handles the details around the inclusion of glfw
|
# <root>/cmake/GlfwImport.cmake handles the details around the inclusion of glfw
|
||||||
if (NOT ${PLATFORM} MATCHES "Web")
|
if (NOT ${PLATFORM} MATCHES "Web")
|
||||||
include(GlfwImport)
|
include(GlfwImport)
|
||||||
|
|
@ -48,10 +56,10 @@ endif ()
|
||||||
# Produces a variable LIBS_PRIVATE that will be used later
|
# Produces a variable LIBS_PRIVATE that will be used later
|
||||||
include(LibraryConfigurations)
|
include(LibraryConfigurations)
|
||||||
|
|
||||||
if (SUPPORT_MODULE_RAUDIO)
|
if (DEFINED SUPPORT_MODULE_RAUDIO AND NOT SUPPORT_MODULE_RAUDIO)
|
||||||
MESSAGE(STATUS "Audio Backend: miniaudio")
|
|
||||||
else ()
|
|
||||||
MESSAGE(STATUS "Audio Backend: None (-DCUSTOMIZE_BUILD=ON -DSUPPORT_MODULE_RAUDIO=OFF)")
|
MESSAGE(STATUS "Audio Backend: None (-DCUSTOMIZE_BUILD=ON -DSUPPORT_MODULE_RAUDIO=OFF)")
|
||||||
|
else ()
|
||||||
|
MESSAGE(STATUS "Audio Backend: miniaudio")
|
||||||
endif ()
|
endif ()
|
||||||
|
|
||||||
add_library(raylib ${raylib_sources} ${raylib_public_headers})
|
add_library(raylib ${raylib_sources} ${raylib_public_headers})
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue
Block a user