CodeQL / Analyze (actions) (push) Canceled after 0s
CodeQL / Analyze (python) (push) Canceled after 0s
pre-commit / pre-commit (push) Canceled after 0s
Multi-Arch CI / setup (push) Canceled after 0s
Publish build_manylinux_x86_64 images / publish_build_manylinux_x86_64 (push) Canceled after 0s
Setup (Multi-Arch) / setup (push) Canceled after 0s
Multi-Arch CI / Linux::${{ fromJSON(needs.setup.outputs.linux_build_config || '{}').build_variant_label || 'skip' }} (push) Canceled after 0s
Publish TheRock Docker image / build-and-push-image (push) Canceled after 0s
Publish no_rocm_image_ubi10 image / publish_no_rocm_image_ubi10 (push) Canceled after 0s
Multi-Arch CI / Windows::${{ fromJSON(needs.setup.outputs.windows_build_config || '{}').build_variant_label || 'skip' }} (push) Canceled after 0s
Publish TheRock Docker image / build-and-push-image (push) Canceled after 0s
Multi-Arch CI / Manifest Diff (push) Canceled after 0s
TheRock Manifest Diff Report / Generate Manifest Diff Report (push) Canceled after 0s
Multi-Arch CI / CI Summary (push) Canceled after 0s
Publish no_rocm_image_ubuntu24_04 images / publish_no_rocm_image_ubuntu24_04 (push) Canceled after 0s
Publish no_rocm_image_ubuntu24_04_ocl_rt images / publish_no_rocm_image_ubuntu24_04_ocl_rt (push) Canceled after 0s
Publish TheRock Docker image / build-and-push-image (push) Canceled after 0s
Publish TheRock Docker image / build-and-push-image (push) Canceled after 0s
Publish no_rocm_image_ubuntu24_04 images / publish_no_rocm_image_ubuntu24_04_rocgdb (push) Canceled after 0s
Publish no_rocm_image_ubuntu24_04_rocgdb images / publish_no_rocm_image_ubuntu24_04_rocgdb (push) Canceled after 0s
Publish no_rocm_image_ubuntu24_04 images / publish_no_rocm_image_ubuntu24_04_ocl_rt (push) Canceled after 0s
Publish TheRock Docker image / build-and-push-image (push) Canceled after 0s
Unit Tests / Unit Tests :: ubuntu-24.04 (push) Canceled after 0s
Unit Tests / Unit Tests :: windows-2022 (push) Canceled after 0s
Publish no_rocm_image_ubuntu24_04 images / publish_no_rocm_image_ubuntu24_04_media (push) Canceled after 0s
Unit Tests / Unit Tests Summary (push) Canceled after 0s
Publish no_rocm_image_ubuntu24_04 images / publish_no_rocm_image_ubuntu24_04_openmpi (push) Canceled after 0s
44 lines
1.3 KiB
CMake
44 lines
1.3 KiB
CMake
file(GENERATE OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/bc2h.c
|
|
CONTENT
|
|
"#include <stdio.h>
|
|
int main(int argc, char **argv){
|
|
FILE *ifp, *ofp;
|
|
int c, i, l;
|
|
if (argc != 4) return 1;
|
|
ifp = fopen(argv[1], \"rb\");
|
|
if (!ifp) return 1;
|
|
i = fseek(ifp, 0, SEEK_END);
|
|
if (i < 0) return 1;
|
|
l = ftell(ifp);
|
|
if (l < 0) return 1;
|
|
i = fseek(ifp, 0, SEEK_SET);
|
|
if (i < 0) return 1;
|
|
ofp = fopen(argv[2], \"wb+\");
|
|
if (!ofp) return 1;
|
|
fprintf(ofp, \"#define %s_size %d\\n\\n\"
|
|
\"#if defined __GNUC__\\n\"
|
|
\"__attribute__((aligned (4096)))\\n\"
|
|
\"#elif defined _MSC_VER\\n\"
|
|
\"__declspec(align(4096))\\n\"
|
|
\"#endif\\n\"
|
|
\"static const unsigned char %s[%s_size+1] = {\",
|
|
argv[3], l,
|
|
argv[3], argv[3]);
|
|
i = 0;
|
|
while ((c = getc(ifp)) != EOF) {
|
|
if (0 == (i&7)) fprintf(ofp, \"\\n \");
|
|
fprintf(ofp, \" 0x%02x,\", c);
|
|
++i;
|
|
}
|
|
fprintf(ofp, \" 0x00\\n};\\n\\n\");
|
|
fclose(ifp);
|
|
fclose(ofp);
|
|
return 0;
|
|
}
|
|
")
|
|
|
|
add_executable(bc2h ${CMAKE_CURRENT_BINARY_DIR}/bc2h.c)
|
|
if (CMAKE_CXX_COMPILER_ID STREQUAL "MSVC")
|
|
target_compile_definitions(bc2h PRIVATE -D_CRT_SECURE_NO_WARNINGS)
|
|
endif()
|