Skip to content
Snippets Groups Projects
Verified Commit 6db84d44 authored by Lars Bilke's avatar Lars Bilke
Browse files

[cmake] check-header, add current lib definitions

parent 434e0407
No related branches found
No related tags found
No related merge requests found
......@@ -6,7 +6,7 @@ check header:
needs: [ meta, ci_images ]
variables:
BUILD_DIR: "../build/check-header"
CMAKE_ARGS: "-DOGS_CHECK_HEADER_COMPILATION=ON -DOGS_BUILD_GUI=ON -DBUILD_SHARED_LIBS=OFF"
CMAKE_ARGS: "-DOGS_CHECK_HEADER_COMPILATION=ON -DOGS_BUILD_GUI=ON -DBUILD_SHARED_LIBS=OFF -DOGS_USE_POETRY=OFF"
image: $CONTAINER_GCC_GUI_IMAGE
script:
- rm -rf $BUILD_DIR
......
......@@ -82,8 +82,19 @@ function(_check_header_compilation target)
${Qt5Gui_INCLUDE_DIRS} ${Qt5Widgets_INCLUDE_DIRS}
)
endif()
get_target_property(COMPILE_DEFINITIONS ${target} _target_defs)
set(CMAKE_REQUIRED_DEFINITIONS ${_target_defs} ${DEFS_CLEANED})
get_target_property(_target_defs ${target} COMPILE_DEFINITIONS)
foreach(def ${_target_defs})
# strip generator expressions
if(${def} MATCHES "\\$<.*")
continue()
endif()
if(${def} MATCHES ".*[0-9]\\(.*")
continue()
endif()
list(APPEND DEFS_CLEANED "-D${def}")
endforeach()
set(CMAKE_REQUIRED_DEFINITIONS ${DEFS_CLEANED})
foreach(file ${SOURCE_FILES})
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment