File tree 1 file changed +21
-0
lines changed
1 file changed +21
-0
lines changed Original file line number Diff line number Diff line change 43
43
cmake --build "${{ github.workspace }}/cmake-build" --config "Debug" --target install
44
44
cmake --build "${{ github.workspace }}/cmake-build" --config "Release" --target install
45
45
46
+ # appended to the end of the build-shared job steps:
47
+ - name : Check Installed Headers Compile Cleanly
48
+ run : |
49
+ mkdir -p header-check
50
+ cd header-check
51
+ cmake -S . -B build -DCMAKE_C_STANDARD=99 -DMYAPI_INCLUDE_DIR="${{ github.workspace }}/install/include" <<EOF
52
+ cmake_minimum_required(VERSION 3.15)
53
+ project(HeaderCheck C)
54
+
55
+ file(GLOB PUBLIC_HEADERS "\${MYAPI_INCLUDE_DIR}/*.h")
56
+
57
+ foreach(header IN LISTS PUBLIC_HEADERS)
58
+ get_filename_component(header_file "\${header}" NAME)
59
+ set(test_source "\${CMAKE_BINARY_DIR}/check_\${header_file}.c")
60
+ file(WRITE "\${test_source}" "#include <\${header_file}>\nint main(void) { return 0; }\n")
61
+ add_executable("check_\${header_file}" "\${test_source}")
62
+ target_include_directories("check_\${header_file}" PRIVATE "\${MYAPI_INCLUDE_DIR}")
63
+ endforeach()
64
+ EOF
65
+ cmake --build build --parallel
66
+
46
67
- name : Upload Artifact
47
68
uses : actions/upload-artifact@v4
48
69
with :
You can’t perform that action at this time.
0 commit comments