Allow empty default values to the dep_option macro

This commit is contained in:
Anonymous Maarten 2022-06-07 04:28:55 +02:00 committed by Sam Lantinga
parent 2cc2260435
commit 5abd676917
2 changed files with 2 additions and 7 deletions

View File

@ -483,11 +483,6 @@ set(SDL_SHARED ${SDL_SHARED_ENABLED_BY_DEFAULT} CACHE BOOL "Build a shared versi
set(SDL_STATIC ${SDL_STATIC_ENABLED_BY_DEFAULT} CACHE BOOL "Build a static version of the library") set(SDL_STATIC ${SDL_STATIC_ENABLED_BY_DEFAULT} CACHE BOOL "Build a static version of the library")
set(SDL_TEST ${SDL_TEST_ENABLED_BY_DEFAULT} CACHE BOOL "Build the SDL2_test library") set(SDL_TEST ${SDL_TEST_ENABLED_BY_DEFAULT} CACHE BOOL "Build the SDL2_test library")
# Some platforms have CMAKE_POSITION_INDEPENDENT_CODE not defined
if(NOT DEFINED CMAKE_POSITION_INDEPENDENT_CODE)
set(CMAKE_POSITION_INDEPENDENT_CODE FALSE)
endif()
dep_option(SDL_STATIC_PIC "Static version of the library should be built with Position Independent Code" "${CMAKE_POSITION_INDEPENDENT_CODE}" "SDL_STATIC" OFF) dep_option(SDL_STATIC_PIC "Static version of the library should be built with Position Independent Code" "${CMAKE_POSITION_INDEPENDENT_CODE}" "SDL_STATIC" OFF)
dep_option(SDL_TESTS "Build the test directory" OFF SDL_TEST OFF) dep_option(SDL_TESTS "Build the test directory" OFF SDL_TEST OFF)
set_option(SDL_INSTALL_TESTS "Install test-cases" OFF) set_option(SDL_INSTALL_TESTS "Install test-cases" OFF)

View File

@ -17,8 +17,8 @@ macro(SET_OPTION _NAME _DESC)
endmacro() endmacro()
macro(DEP_OPTION _NAME _DESC _DEFLT _DEPTEST _FAILDFLT) macro(DEP_OPTION _NAME _DESC _DEFLT _DEPTEST _FAILDFLT)
add_to_alloptions(${_NAME}) add_to_alloptions("${_NAME}")
cmake_dependent_option(${_NAME} ${_DESC} ${_DEFLT} ${_DEPTEST} ${_FAILDFLT}) cmake_dependent_option("${_NAME}" "${_DESC}" "${_DEFLT}" "${_DEPTEST}" "${_FAILDFLT}")
endmacro() endmacro()
macro(OPTION_STRING _NAME _DESC _VALUE) macro(OPTION_STRING _NAME _DESC _VALUE)