Skip to content

Commit 91672a1

Browse files
committed
CMakeLists.txt is needed
1 parent 4f7c018 commit 91672a1

File tree

1 file changed

+11
-9
lines changed

1 file changed

+11
-9
lines changed

.github/workflows/build_linux.yml

+11-9
Original file line numberDiff line numberDiff line change
@@ -46,22 +46,24 @@ jobs:
4646
- name: Check Installed Headers Compile Cleanly
4747
run: |
4848
mkdir -p header-check
49-
cd header-check
50-
cmake -S . -B build -DCMAKE_C_STANDARD=99 -DPM_INCLUDE_DIR="${{ github.workspace }}/install/include" <<EOF
49+
cat <<EOF > header-check/CMakeLists.txt
5150
cmake_minimum_required(VERSION 3.15)
5251
project(HeaderCheck C)
5352
54-
file(GLOB PUBLIC_HEADERS "\${PM_INCLUDE_DIR}/*.h")
53+
set(PROJECTM_INCLUDE_DIR "${{ github.workspace }}/install/include")
54+
file(GLOB PUBLIC_HEADERS "\${PROJECTM_INCLUDE_DIR}/*.h")
5555
5656
foreach(header IN LISTS PUBLIC_HEADERS)
57-
get_filename_component(header_file "\${header}" NAME)
58-
set(test_source "\${CMAKE_BINARY_DIR}/check_\${header_file}.c")
59-
file(WRITE "\${test_source}" "#include <\${header_file}>\nint main(void) { return 0; }\n")
60-
add_executable("check_\${header_file}" "\${test_source}")
61-
target_include_directories("check_\${header_file}" PRIVATE "\${PM_INCLUDE_DIR}")
57+
get_filename_component(header_file "\${header}" NAME)
58+
set(test_source "\${CMAKE_BINARY_DIR}/check_\${header_file}.c")
59+
file(WRITE "\${test_source}" "#include <\${header_file}>\nint main(void) { return 0; }\n")
60+
add_executable("check_\${header_file}" "\${test_source}")
61+
target_include_directories("check_\${header_file}" PRIVATE "\${PROJECTM_INCLUDE_DIR}")
6262
endforeach()
6363
EOF
64-
cmake --build build --parallel
64+
65+
cmake -S header-check -B header-check/build -DCMAKE_C_STANDARD=99
66+
cmake --build header-check/build --parallel
6567
6668
- name: Upload Artifact
6769
uses: actions/upload-artifact@v4

0 commit comments

Comments
 (0)