Skip to content

Commit c5cdd71

Browse files
committed
Update CMake action to use latest
1 parent 7b24a51 commit c5cdd71

File tree

5 files changed

+154
-65
lines changed

5 files changed

+154
-65
lines changed

.github/workflows/cmake-ctest.yml

Lines changed: 41 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,10 @@ on:
2626
type: string
2727
required: true
2828
default: snapshots
29+
cmake_version:
30+
description: "3.18.0 or later, latest"
31+
required: true
32+
type: string
2933
secrets:
3034
APPLE_CERTS_BASE64:
3135
required: true
@@ -86,9 +90,16 @@ jobs:
8690
uses: ilammy/[email protected]
8791

8892
- name: Install CMake
89-
uses: jwlawson/actions-setup-cmake@v2
93+
uses: lukka/get-cmake@latest
9094
with:
91-
cmake-version: '3.31.6'
95+
cmakeVersion: ${{ inputs.cmake_version }}
96+
ninjaVersion: latest
97+
98+
- name: Check CMake Version
99+
shell: bash
100+
run: |
101+
which cmake
102+
cmake --version
92103
93104
- name: Set file base name (Windows)
94105
id: set-file-base
@@ -203,7 +214,7 @@ jobs:
203214
shell: bash
204215

205216
- name: Sign files with Trusted Signing
206-
uses: azure/[email protected].1
217+
uses: azure/[email protected].9
207218
with:
208219
azure-tenant-id: ${{ secrets.AZURE_TENANT_ID }}
209220
azure-client-id: ${{ secrets.AZURE_CLIENT_ID }}
@@ -271,9 +282,16 @@ jobs:
271282
sudo apt-get install ninja-build
272283
273284
- name: Install CMake
274-
uses: jwlawson/actions-setup-cmake@v2
285+
uses: lukka/get-cmake@latest
275286
with:
276-
cmake-version: '3.31.6'
287+
cmakeVersion: ${{ inputs.cmake_version }}
288+
ninjaVersion: latest
289+
290+
- name: Check CMake Version
291+
shell: bash
292+
run: |
293+
which cmake
294+
cmake --version
277295
278296
- name: Set file base name (Linux)
279297
id: set-file-base
@@ -414,6 +432,24 @@ jobs:
414432
- name: Install Dependencies (MacOS_latest)
415433
run: brew install ninja
416434

435+
- name: check clang version
436+
shell: bash
437+
run: |
438+
which clang
439+
clang -v
440+
441+
- name: Install CMake
442+
uses: lukka/get-cmake@latest
443+
with:
444+
cmakeVersion: ${{ inputs.cmake_version }}
445+
ninjaVersion: latest
446+
447+
- name: Check CMake Version
448+
shell: bash
449+
run: |
450+
which cmake
451+
cmake --version
452+
417453
- name: Install the Apple certificate and provisioning profile
418454
shell: bash
419455
env:
@@ -436,11 +472,6 @@ jobs:
436472
security -v set-key-partition-list -S apple-tool:,codesign:,apple: -k $KEYCHAIN_PASSWD $KEYCHAIN_FILE
437473
if: ${{ needs.check-secret.outputs.sign-state == 'exists' }}
438474

439-
- name: Install CMake
440-
uses: jwlawson/actions-setup-cmake@v2
441-
with:
442-
cmake-version: '3.31.6'
443-
444475
- name: Set file base name (MacOS_latest)
445476
id: set-file-base
446477
run: |

.github/workflows/cmake-script.yml

Lines changed: 37 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,10 @@ on:
2222
type: string
2323
required: true
2424
default: snapshots
25+
cmake_version:
26+
description: "3.18.0 or later, latest"
27+
required: true
28+
type: string
2529

2630
permissions:
2731
contents: read
@@ -40,9 +44,16 @@ jobs:
4044
uses: ilammy/[email protected]
4145

4246
- name: Install CMake
43-
uses: jwlawson/actions-setup-cmake@v2
47+
uses: lukka/get-cmake@latest
4448
with:
45-
cmake-version: '3.31.6'
49+
cmakeVersion: ${{ inputs.cmake_version }}
50+
ninjaVersion: latest
51+
52+
- name: Check CMake Version
53+
shell: bash
54+
run: |
55+
which cmake
56+
cmake --version
4657
4758
- name: Set file base name (Windows)
4859
id: set-file-base
@@ -185,9 +196,10 @@ jobs:
185196
sudo apt-get install ninja-build graphviz curl
186197
187198
- name: Install CMake
188-
uses: jwlawson/actions-setup-cmake@v2
199+
uses: lukka/get-cmake@latest
189200
with:
190-
cmake-version: '3.31.6'
201+
cmakeVersion: ${{ inputs.cmake_version }}
202+
ninjaVersion: latest
191203

192204
- name: Set file base name (Linux)
193205
id: set-file-base
@@ -308,10 +320,23 @@ jobs:
308320
- name: Install Dependencies (MacOS_latest)
309321
run: brew install ninja
310322

323+
- name: check clang version
324+
shell: bash
325+
run: |
326+
which clang
327+
clang -v
328+
311329
- name: Install CMake
312-
uses: jwlawson/actions-setup-cmake@v2
330+
uses: lukka/get-cmake@latest
313331
with:
314-
cmake-version: '3.31.6'
332+
cmakeVersion: ${{ inputs.cmake_version }}
333+
ninjaVersion: latest
334+
335+
- name: Check CMake Version
336+
shell: bash
337+
run: |
338+
which cmake
339+
cmake --version
315340
316341
- name: Set file base name (MacOS_latest)
317342
id: set-file-base
@@ -442,9 +467,10 @@ jobs:
442467
version: '2025.0'
443468

444469
- name: Install CMake
445-
uses: jwlawson/actions-setup-cmake@v2
470+
uses: lukka/get-cmake@latest
446471
with:
447-
cmake-version: '3.31.6'
472+
cmakeVersion: ${{ inputs.cmake_version }}
473+
ninjaVersion: latest
448474

449475
- name: Set file base name (Windows_intel)
450476
id: set-file-base
@@ -598,9 +624,10 @@ jobs:
598624
version: '2025.0'
599625

600626
- name: Install CMake
601-
uses: jwlawson/actions-setup-cmake@v2
627+
uses: lukka/get-cmake@latest
602628
with:
603-
cmake-version: '3.31.6'
629+
cmakeVersion: ${{ inputs.cmake_version }}
630+
ninjaVersion: latest
604631

605632
- name: Set file base name (Linux_intel)
606633
id: set-file-base

.github/workflows/daily-build.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -71,6 +71,7 @@ jobs:
7171
needs: [get-old-names, call-workflow-tarball]
7272
uses: ./.github/workflows/cmake-script.yml
7373
with:
74+
cmake_version: "latest"
7475
file_base: ${{ needs.call-workflow-tarball.outputs.file_base }}
7576
use_hdf: ${{ needs.get-old-names.outputs.hdf5-name }}
7677
use_environ: snapshots
@@ -80,6 +81,7 @@ jobs:
8081
needs: [get-old-names, call-workflow-tarball]
8182
uses: ./.github/workflows/cmake-ctest.yml
8283
with:
84+
cmake_version: 'latest'
8385
preset_name: ci-StdShar
8486
file_base: ${{ needs.call-workflow-tarball.outputs.file_base }}
8587
use_hdf: ${{ needs.get-old-names.outputs.hdf5-name }}

.github/workflows/release.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,7 @@ jobs:
4545
needs: [log-the-inputs, call-workflow-tarball]
4646
uses: ./.github/workflows/cmake-ctest.yml
4747
with:
48+
cmake_version: "latest"
4849
preset_name: ci-StdShar
4950
file_base: ${{ needs.call-workflow-tarball.outputs.file_base }}
5051
use_hdf: ${{ needs.log-the-inputs.outputs.hdf_tag }}

BLOSC/config/zlib-CMakeLists.txt

Lines changed: 73 additions & 45 deletions
Original file line numberDiff line numberDiff line change
@@ -1,70 +1,75 @@
1-
cmake_minimum_required(VERSION 2.4.4...3.15.0)
2-
set(CMAKE_ALLOW_LOOSE_LOOP_CONSTRUCTS ON)
3-
4-
project(zlib C)
1+
cmake_minimum_required (VERSION 3.18)
2+
set (CMAKE_ALLOW_LOOSE_LOOP_CONSTRUCTS ON)
3+
project (ZLIB C)
54

65
set(VERSION "1.3.1")
76

8-
include(CheckTypeSize)
9-
include(CheckFunctionExists)
10-
include(CheckIncludeFile)
11-
include(CheckCSourceCompiles)
12-
enable_testing()
7+
include (CheckTypeSize)
8+
include (CheckFunctionExists)
9+
include (CheckIncludeFile)
10+
include (CheckCSourceCompiles)
1311

14-
check_include_file(sys/types.h HAVE_SYS_TYPES_H)
15-
check_include_file(stdint.h HAVE_STDINT_H)
16-
check_include_file(stddef.h HAVE_STDDEF_H)
12+
check_include_file (sys/types.h HAVE_SYS_TYPES_H)
13+
check_include_file (stdint.h HAVE_STDINT_H)
14+
check_include_file (stddef.h HAVE_STDDEF_H)
1715

1816
#
1917
# Check to see if we have large file support
2018
#
21-
set(CMAKE_REQUIRED_DEFINITIONS -D_LARGEFILE64_SOURCE=1)
19+
set (CMAKE_REQUIRED_DEFINITIONS -D_LARGEFILE64_SOURCE=1)
2220
# We add these other definitions here because CheckTypeSize.cmake
2321
# in CMake 2.4.x does not automatically do so and we want
2422
# compatibility with CMake 2.4.x.
25-
if(HAVE_SYS_TYPES_H)
26-
list(APPEND CMAKE_REQUIRED_DEFINITIONS -DHAVE_SYS_TYPES_H)
27-
endif()
28-
if(HAVE_STDINT_H)
29-
list(APPEND CMAKE_REQUIRED_DEFINITIONS -DHAVE_STDINT_H)
30-
endif()
31-
if(HAVE_STDDEF_H)
32-
list(APPEND CMAKE_REQUIRED_DEFINITIONS -DHAVE_STDDEF_H)
33-
endif()
34-
check_type_size(off64_t OFF64_T)
35-
if(HAVE_OFF64_T)
36-
add_definitions(-D_LARGEFILE64_SOURCE=1)
37-
endif()
38-
set(CMAKE_REQUIRED_DEFINITIONS) # clear variable
23+
if (HAVE_SYS_TYPES_H)
24+
list(APPEND CMAKE_REQUIRED_DEFINITIONS -DHAVE_SYS_TYPES_H)
25+
endif ()
26+
if (HAVE_STDINT_H)
27+
list(APPEND CMAKE_REQUIRED_DEFINITIONS -DHAVE_STDINT_H)
28+
endif ()
29+
if (HAVE_STDDEF_H)
30+
list(APPEND CMAKE_REQUIRED_DEFINITIONS -DHAVE_STDDEF_H)
31+
endif ()
32+
check_type_size (off64_t OFF64_T)
33+
if (HAVE_OFF64_T)
34+
add_definitions(-D_LARGEFILE64_SOURCE=1)
35+
endif ()
36+
set (CMAKE_REQUIRED_DEFINITIONS) # clear variable
3937

4038
#
4139
# Check for fseeko
4240
#
43-
check_function_exists(fseeko HAVE_FSEEKO)
44-
if(NOT HAVE_FSEEKO)
45-
add_definitions(-DNO_FSEEKO)
46-
endif()
41+
check_function_exists (fseeko HAVE_FSEEKO)
42+
if (NOT HAVE_FSEEKO)
43+
add_definitions (-DNO_FSEEKO)
44+
endif ()
4745

4846
#
4947
# Check for unistd.h
5048
#
51-
check_include_file(unistd.h Z_HAVE_UNISTD_H)
49+
check_include_file (unistd.h Z_HAVE_UNISTD_H)
50+
51+
if (MSVC)
52+
set(CMAKE_DEBUG_POSTFIX "d")
53+
add_definitions (-D_BIND_TO_CURRENT_VCLIBS_VERSION=1)
54+
add_definitions (-D_CRT_SECURE_NO_DEPRECATE)
55+
add_definitions (-D_CRT_SECURE_NO_WARNINGS)
56+
add_definitions (-D_CONSOLE)
57+
add_definitions(-D_CRT_NONSTDC_NO_DEPRECATE)
58+
include_directories(${CMAKE_CURRENT_SOURCE_DIR})
59+
endif ()
5260

53-
if(MSVC)
54-
set(CMAKE_DEBUG_POSTFIX "d")
55-
add_definitions(-D_CRT_SECURE_NO_DEPRECATE)
56-
add_definitions(-D_CRT_NONSTDC_NO_DEPRECATE)
57-
include_directories(${CMAKE_CURRENT_SOURCE_DIR})
58-
endif()
61+
#============================================================================
62+
# zconf.h
63+
#============================================================================
5964

6065
if(NOT CMAKE_CURRENT_SOURCE_DIR STREQUAL CMAKE_CURRENT_BINARY_DIR)
6166
# If we're doing an out of source build and the user has a zconf.h
6267
# in their source tree...
6368
if(EXISTS ${CMAKE_CURRENT_SOURCE_DIR}/zconf.h)
64-
message(STATUS "Renaming")
65-
message(STATUS " ${CMAKE_CURRENT_SOURCE_DIR}/zconf.h")
66-
message(STATUS "to 'zconf.h.included' because this file is included with zlib")
67-
message(STATUS "but CMake generates it automatically in the build directory.")
69+
message(VERBOSE "Renaming")
70+
message(VERBOSE " ${CMAKE_CURRENT_SOURCE_DIR}/zconf.h")
71+
message(VERBOSE "to 'zconf.h.included' because this file is included with zlib")
72+
message(VERBOSE "but CMake generates it automatically in the build directory.")
6873
file(RENAME ${CMAKE_CURRENT_SOURCE_DIR}/zconf.h ${CMAKE_CURRENT_SOURCE_DIR}/zconf.h.included)
6974
endif()
7075
endif()
@@ -77,9 +82,9 @@ configure_file( ${CMAKE_CURRENT_SOURCE_DIR}/zconf.h.cmakein
7782
include_directories(${CMAKE_CURRENT_BINARY_DIR} ${CMAKE_SOURCE_DIR})
7883

7984

80-
#============================================================================
81-
# zlib
82-
#============================================================================
85+
#-----------------------------------------------------------------------------
86+
# Define ZLIB Library
87+
#-----------------------------------------------------------------------------
8388

8489
set(ZLIB_PUBLIC_HDRS
8590
${CMAKE_CURRENT_BINARY_DIR}/zconf.h
@@ -141,4 +146,27 @@ if(MINGW)
141146
set(ZLIB_DLL_SRCS ${CMAKE_CURRENT_BINARY_DIR}/zlib1rc.obj)
142147
endif(MINGW)
143148

149+
### Define library
144150
add_library(zlibstat STATIC ${ZLIB_SRCS} ${ZLIB_PUBLIC_HDRS} ${ZLIB_PRIVATE_HDRS})
151+
if (MSVC AND CMAKE_CL_64)
152+
set_target_properties (zlibstat PROPERTIES STATIC_LIBRARY_FLAGS "/machine:x64")
153+
endif ()
154+
set_target_properties(zlibstat PROPERTIES
155+
PUBLIC_HEADER ""
156+
LINKER_LANGUAGE C
157+
INTERFACE_INCLUDE_DIRECTORIES "$<INSTALL_INTERFACE:$<INSTALL_PREFIX>/include>"
158+
)
159+
160+
#-----------------------------------------------------------------------------
161+
# Compiler specific flags
162+
#-----------------------------------------------------------------------------
163+
if (CMAKE_C_COMPILER_ID STREQUAL "GNU")
164+
target_compile_options(zlibstat PRIVATE -Wno-strict-prototypes -Wno-implicit-function-declaration)
165+
endif ()
166+
if (CMAKE_C_COMPILER_ID MATCHES "IntelLLVM" OR CMAKE_C_COMPILER_ID MATCHES "[Cc]lang")
167+
target_compile_options(zlibstat PRIVATE -Wno-implicit-function-declaration)
168+
endif ()
169+
if (CMAKE_C_COMPILER_ID STREQUAL "GNU")
170+
target_compile_options(zlibstat PRIVATE -fmessage-length=0)
171+
endif ()
172+

0 commit comments

Comments
 (0)