Skip to content

Commit

Permalink
chore(cmake): set options changes as cache and with force
Browse files Browse the repository at this point in the history
Without this, changes will not propergate to a parent if
toxcore is used as a subdirectory.
  • Loading branch information
Green-Sky committed Nov 6, 2024
1 parent 03e9fbf commit e9076f4
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -161,7 +161,7 @@ option(DHT_BOOTSTRAP "Enable building of DHT_bootstrap" ON)
option(BOOTSTRAP_DAEMON "Enable building of tox-bootstrapd" ON)
if(BOOTSTRAP_DAEMON AND WIN32)
message(WARNING "Building tox-bootstrapd for Windows is not supported, disabling")
set(BOOTSTRAP_DAEMON OFF)
set(BOOTSTRAP_DAEMON OFF CACHE BOOL "" FORCE)
endif()

option(BUILD_FUZZ_TESTS "Build fuzzing harnesses" OFF)
Expand All @@ -177,18 +177,19 @@ include(Dependencies)

if(MUST_BUILD_TOXAV)
set(NO_TOXAV_ERROR_TYPE SEND_ERROR)
set(BUILD_TOXAV ON CACHE BOOL "" FORCE)
else()
set(NO_TOXAV_ERROR_TYPE WARNING)
endif()

if(BUILD_TOXAV)
if(NOT OPUS_FOUND)
message(${NO_TOXAV_ERROR_TYPE} "Option BUILD_TOXAV is enabled but required library OPUS was not found.")
set(BUILD_TOXAV OFF)
set(BUILD_TOXAV OFF CACHE BOOL "" FORCE)
endif()
if(NOT VPX_FOUND)
message(${NO_TOXAV_ERROR_TYPE} "Option BUILD_TOXAV is enabled but required library VPX was not found.")
set(BUILD_TOXAV OFF)
set(BUILD_TOXAV OFF CACHE BOOL "" FORCE)
endif()
endif()

Expand Down Expand Up @@ -597,7 +598,7 @@ if(BOOTSTRAP_DAEMON)
add_subdirectory(other/bootstrap_daemon)
else()
message(WARNING "Option BOOTSTRAP_DAEMON is enabled but required library LIBCONFIG was not found.")
set(BOOTSTRAP_DAEMON OFF)
set(BOOTSTRAP_DAEMON OFF CACHE BOOL "" FORCE)
endif()
endif()

Expand Down

0 comments on commit e9076f4

Please sign in to comment.