From b79ce1299ab6eb337364e9368fa3d09789bf63ed Mon Sep 17 00:00:00 2001 From: Paul-Louis Ageneau Date: Tue, 16 Jul 2024 14:08:28 +0200 Subject: [PATCH] Merge pull request #1231 from pschichtel/feature/immutable-source-dir Disable the version.h update by default --- .github/workflows/check-version.yml | 2 +- CMakeLists.txt | 11 +++++++---- 2 files changed, 8 insertions(+), 5 deletions(-) diff --git a/.github/workflows/check-version.yml b/.github/workflows/check-version.yml index 7e095eea7..ca6b404ce 100644 --- a/.github/workflows/check-version.yml +++ b/.github/workflows/check-version.yml @@ -14,7 +14,7 @@ jobs: - name: submodules run: git submodule update --init --recursive --depth 1 - name: cmake - run: cmake -B build -DUSE_GNUTLS=0 -DUSE_SYSTEM_SRTP=1 -DWARNINGS_AS_ERRORS=1 + run: cmake -B build -DUSE_GNUTLS=0 -DUSE_SYSTEM_SRTP=1 -DWARNINGS_AS_ERRORS=1 -DRTC_UPDATE_VERSION_HEADER=1 - name: check diff run: | if ! git diff --exit-code diff --git a/CMakeLists.txt b/CMakeLists.txt index 8a61757f9..47c504951 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -23,6 +23,7 @@ option(NO_TESTS "Disable tests build" OFF) option(WARNINGS_AS_ERRORS "Treat warnings as errors" OFF) option(CAPI_STDCALL "Set calling convention of C API callbacks stdcall" OFF) option(SCTP_DEBUG "Enable SCTP debugging output to verbose log" OFF) +option(RTC_UPDATE_VERSION_HEADER "Enable updating the version header" OFF) if (USE_GNUTLS AND USE_MBEDTLS) message(FATAL_ERROR "Both USE_MBEDTLS and USE_GNUTLS cannot be enabled at the same time") @@ -260,10 +261,12 @@ else() add_library(Usrsctp::Usrsctp ALIAS usrsctp) endif() -configure_file ( - ${PROJECT_SOURCE_DIR}/cmake/version.h.in - ${CMAKE_CURRENT_SOURCE_DIR}/include/rtc/version.h -) +if(RTC_UPDATE_VERSION_HEADER) + configure_file ( + ${PROJECT_SOURCE_DIR}/cmake/version.h.in + ${CMAKE_CURRENT_SOURCE_DIR}/include/rtc/version.h + ) +endif() add_library(datachannel SHARED ${LIBDATACHANNEL_SOURCES}