diff --git a/.github/workflows/nginx-otel-module-check.yml b/.github/workflows/nginx-otel-module-check.yml index 2d8f5ee..bad1a32 100644 --- a/.github/workflows/nginx-otel-module-check.yml +++ b/.github/workflows/nginx-otel-module-check.yml @@ -24,7 +24,8 @@ jobs: - name: Build module working-directory: build run: | - cmake -DNGX_OTEL_NGINX_BUILD_DIR=${PWD}/../nginx/objs .. + cmake -DNGX_OTEL_NGINX_BUILD_DIR=${PWD}/../nginx/objs \ + -DNGX_OTEL_DEV=ON .. make -j 4 strip ngx_otel_module.so - name: Archive module @@ -75,11 +76,11 @@ jobs: working-directory: nginx run: | auto/configure --with-compat --with-debug --with-http_ssl_module \ - --with-http_v2_module --with-http_v3_module + --with-http_v2_module --with-http_v3_module make -j 4 - name: Run tests working-directory: tests run: | PERL5LIB=../nginx-tests/lib TEST_NGINX_UNSAFE=1 \ - TEST_NGINX_VERBOSE=1 TEST_NGINX_GLOBALS="load_module \ - ${PWD}/../build/ngx_otel_module.so;" prove -v . + TEST_NGINX_VERBOSE=1 TEST_NGINX_GLOBALS="load_module \ + ${PWD}/../build/ngx_otel_module.so;" prove -v . diff --git a/CMakeLists.txt b/CMakeLists.txt index ea972ad..50c0c55 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -6,8 +6,9 @@ set(NGX_OTEL_NGINX_BUILD_DIR "" set(NGX_OTEL_NGINX_DIR "${NGX_OTEL_NGINX_BUILD_DIR}/.." CACHE PATH "Nginx source dir") -set(NGX_OTEL_FETCH_DEPS ON CACHE BOOL "Download dependencies") -set(NGX_OTEL_PROTO_DIR "" CACHE PATH "OTel proto files root") +set(NGX_OTEL_FETCH_DEPS ON CACHE BOOL "Download dependencies") +set(NGX_OTEL_PROTO_DIR "" CACHE PATH "OTel proto files root") +set(NGX_OTEL_DEV OFF CACHE BOOL "Enforce compiler warnings") if(NOT CMAKE_BUILD_TYPE) set(CMAKE_BUILD_TYPE RelWithDebInfo) @@ -99,7 +100,9 @@ add_custom_command( set(CMAKE_CXX_STANDARD 11) set(CMAKE_CXX_EXTENSIONS OFF) -add_compile_options(-Wall -Wtype-limits -Werror) +if (NGX_OTEL_DEV) + add_compile_options(-Wall -Wtype-limits -Werror) +endif() add_library(ngx_otel_module MODULE src/http_module.cpp