← All tasks
cppyhirose/cpp-httplib #638Not a task: already works

CMake 3.18.2 on linux + GCC 10.2 cmake makes empty -D options

envgap__yhirose__cpp-httplib-638

01 / FAILURE SIGNATURE

As reported upstream

No identifying execution failure has been captured.
Not a benchmark task.
  • The project already builds and runs before the fix, so there is nothing to repair.

02 / ENVIRONMENT RECIPE

Base commit
3da4a0ac69574c4998af05009d237454c481e071
Manifest
CMakeLists.txt
Reproduce
Awaiting issue-specific recipe
Run under trace
Awaiting a meaningful runtime command

03 / ORIGINAL ISSUE TEXT

yhirose/cpp-httplib #638 · read the original issue
the quote marks in the cmake file confuse cmake and result in the command line doing silly things like `-D\"CPPHTTPLIB_BROTLI_SUPPORT\"`. Which confuses everything involved resulting in a failed build.



solution is to change the following:

```cmake

# Set the definitions to enable optional features

target_compile_definitions(${PROJECT_NAME} ${_INTERFACE_OR_PUBLIC}

	$<$<BOOL:${HTTPLIB_IS_USING_BROTLI}>:"CPPHTTPLIB_BROTLI_SUPPORT">

	$<$<BOOL:${HTTPLIB_IS_USING_ZLIB}>:"CPPHTTPLIB_ZLIB_SUPPORT">

	$<$<BOOL:${HTTPLIB_IS_USING_OPENSSL}>:"CPPHTTPLIB_OPENSSL_SUPPORT">

)

```



to



```cmake

# Set the definitions to enable optional features

target_compile_definitions(${PROJECT_NAME} ${_INTERFACE_OR_PUBLIC}

	$<$<BOOL:${HTTPLIB_IS_USING_BROTLI}>:CPPHTTPLIB_BROTLI_SUPPORT>

	$<$<BOOL:${HTTPLIB_IS_USING_ZLIB}>:CPPHTTPLIB_ZLIB_SUPPORT>

	$<$<BOOL:${HTTPLIB_IS_USING_OPENSSL}>:CPPHTTPLIB_OPENSSL_SUPPORT>

)

```



tested:

* Win10 - MSVC2017

* Arch Linux - GCC 10.2
Continue on GitHub ↗

04 / LABELS

Labels from the report text only; not yet run

No supported category has been assigned.

Label rules and the text that matched
[]