mirror of
https://github.com/visualboyadvance-m/visualboyadvance-m
synced 2025-10-05 15:42:52 +02:00
build: check CMake variable ENABLE_SHARED
Check for the commonly used CMake variable `ENABLE_SHARED` and set `VBAM_STATIC` accordingly if it is set. Signed-off-by: Rafael Kitover <rkitover@gmail.com>
This commit is contained in:
@@ -22,8 +22,18 @@ elseif(MINGW OR MSYS)
|
||||
# Default to static builds on MinGW and all MSYS2 envs.
|
||||
set(VBAM_STATIC_DEFAULT ON)
|
||||
endif()
|
||||
|
||||
option(VBAM_STATIC "Try to link all libraries statically" ${VBAM_STATIC_DEFAULT})
|
||||
|
||||
# This is a commonly used CMake option.
|
||||
if(DEFINED ENABLE_SHARED)
|
||||
if(NOT ENABLE_SHARED)
|
||||
set(VBAM_STATIC ON)
|
||||
else()
|
||||
set(VBAM_STATIC OFF)
|
||||
endif()
|
||||
endif()
|
||||
|
||||
if(VBAM_STATIC)
|
||||
set(SDL2_STATIC ON)
|
||||
set(SDL3_STATIC ON)
|
||||
|
Reference in New Issue
Block a user