| 1 |
# hqx 1.2 |
| 2 |
|
| 3 |
add_library(hqx STATIC hq2x.c hq3x.c hq4x.c init.c) |
| 4 |
|
| 5 |
set_property(TARGET hqx PROPERTY POSITION_INDEPENDENT_CODE TRUE) |
| 6 |
|
| 7 |
# Clang warns that passing a uint32_t to abs() has no effect, which is |
| 8 |
# not true: on systems with 32-bit int, any value in a uint32_t greater |
| 9 |
# than 0x7fffffff will be converted to a negative value when it's passed |
| 10 |
# in, and then rendered positive: for example, 0xffffffff will convert |
| 11 |
# to -1, and be returned as 1. The call is dodgy because it expects int |
| 12 |
# to be 32 bits (which is probable), and wrap around as in 2's |
| 13 |
# complement (which is all but guaranteed); but it's probably going to |
| 14 |
# work, and the warning is unnecessary. |
| 15 |
if(CMAKE_C_COMPILER_ID STREQUAL "Clang") |
| 16 |
target_compile_options(hqx PRIVATE -Wno-absolute-value) |
| 17 |
endif() |
| 18 |
|
| 19 |
target_include_directories(hqx PUBLIC ${CMAKE_CURRENT_SOURCE_DIR}) |