8000 Straight cmake upgrade · VXAPPS/sqlite_functions@23dfba4 · GitHub
[go: up one dir, main page]

Skip to content

Commit 23dfba4

Browse files
committed
Straight cmake upgrade
CodeQL integrations
1 parent a776e09 commit 23dfba4

11 files changed

+346
-20
lines changed

.github/workflows/linux-codeql.yml

Lines changed: 142 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,142 @@
1+
name: linux CodeQL
2+
3+
on: [workflow_dispatch]
4+
5+
jobs:
6+
7+
Build:
8+
name: ${{matrix.name}} (${{matrix.config}})
9+
runs-on: ${{matrix.os}}
10+
11+
env:
12+
CMAKE_GENERATOR: Ninja
13+
14+
strategy:
15+
fail-fast: false
16+
matrix:
17+
name: [
18+
ubuntu-20.04-gcc-9,
19+
ubuntu-20.04-gcc-10,
20+
ubuntu-22.04-gcc-11,
21+
ubuntu-22.04-gcc-12,
22+
ubuntu-20.04-clang-8,
23+
ubuntu-20.04-clang-9,
24+
ubuntu-20.04-clang-10,
25+
ubuntu-22.04-clang-11,
26+
ubuntu-22.04-clang-12,
27+
ubuntu-22.04-clang-13,
28+
ubuntu-22.04-clang-14,
29+
ubuntu-22.04-clang-15
30+
]
31+
config: [Debug, Release]
32+
include:
33+
- name: ubuntu-20.04-gcc-9
34+
os: ubuntu-20.04
35+
compiler: gcc
36+
version: 9
37+
38+
- name: ubuntu-20.04-gcc-10
39+
os: ubuntu-20.04
40+
compiler: gcc
41+
version: 10
42+
43+
- name: ubuntu-22.04-gcc-11
44+
os: ubuntu-22.04
45+
compiler: gcc
46+
version: 11
47+
48+
- name: ubuntu-22.04-gcc-12
49+
os: ubuntu-22.04
50+
compiler: gcc
51+
version: 12
52+
53+
- name: ubuntu-20.04-clang-8
54+
os: ubuntu-20.04
55+
compiler: clang
56+
version: 8
57+
58+
- name: ubuntu-20.04-clang-9
59+
os: ubuntu-20.04
60+
compiler: clang
61+
version: 9
62+
63+
- name: ubuntu-20.04-clang-10
64+
os: ubuntu-20.04
65+
compiler: clang
66+
version: 10
67+
68+
- name: ubuntu-22.04-clang-11
69+
os: ubuntu-22.04
70+
compiler: clang
71+
version: 11
72+
73+
- name: ubuntu-22.04-clang-12
74+
os: ubuntu-22.04
75+
compiler: clang
76+
version: 12
77+
78+
- name: ubuntu-22.04-clang-13
79+
os: ubuntu-22.04
80+
compiler: clang
81+
version: 13
82+
83+
- name: ubuntu-22.04-clang-14
84+
os: ubuntu-22.04
85+
compiler: clang
86+
version: 14
87+
88+
- name: ubuntu-22.04-clang-15
89+
os: ubuntu-22.04
90+
compiler: clang
91+
version: 15
92+
93+
steps:
94+
- uses: actions/checkout@v3
95+
96+
- name: Dependencies
97+
run: |
98+
if [ "${{matrix.version}}" = "15" ]; then
99+
wget -O - https://apt.llvm.org/llvm-snapshot.gpg.key|gpg --dearmor > llvm-snapshot.gpg
100+
sudo mv llvm-snapshot.gpg /etc/apt/trusted.gpg.d/
101+
sudo apt-add-repository "deb http://apt.llvm.org/jammy/ llvm-toolchain-jammy-15 main"
102+
fi
103+
104+
sudo apt update
105+
sudo apt install -y ninja-build
106+
sudo apt install -y doxygen graphviz
107+
sudo apt install -y libicu-dev
108+
sudo apt install -y sqlite3
109+
110+
if [ "${{matrix.compiler}}" = "gcc" ]; then
111+
sudo apt install -y g++-${{matrix.version}}
112+
echo "CC=gcc-${{matrix.version}}" >> $GITHUB_ENV
113+
echo "CXX=g++-${{matrix.version}}" >> $GITHUB_ENV
114+
else
115+
sudo apt install -y clang-${{matrix.version}} lld-${{matrix.version}}
116+
sudo apt install -y libc++-${{matrix.version}}-dev libc++abi-${{matrix.version}}-dev
117+
# libunwind is new to clang-12, but not a dependency for the initial version
118+
if [ "${{matrix.version}}" = "12" ]; then
119+
sudo apt install -y libunwind-${{matrix.version}}-dev
120+
fi
121+
echo "CC=clang-${{matrix.version}}" >> $GITHUB_ENV
122+
echo "CXX=clang++-${{matrix.version}}" >> $GITHUB_ENV
123+
fi
124+
125+
- name: Initialize CodeQL
126+
uses: github/codeql-action/init@v2
127+
with:
128+
languages: 'cpp'
129+
130+
- name: Create Build Environment
131+
run: cmake -E make_directory ${{runner.workspace}}/build
132+
133+
- name: Configure CMake
134+
working-directory: ${{runner.workspace}}/build
135+
run: cmake $GITHUB_WORKSPACE -DCMAKE_BUILD_TYPE:STRING=${{matrix.config}}
136+
137+
- name: Build
138+
working-directory: ${{runner.workspace}}/build
139+
run: cmake --build . --config ${{matrix.config}}
140+
141+
- name: Perform CodeQL Analysis
142+
uses: github/codeql-action/analyze@v2

.github/workflows/linux.yml

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -98,7 +98,7 @@ jobs:
9898
if [ "${{matrix.version}}" = "15" ]; then
9999
wget -O - https://apt.llvm.org/llvm-snapshot.gpg.key|gpg --dearmor > llvm-snapshot.gpg
100100
sudo mv llvm-snapshot.gpg /etc/apt/trusted.gpg.d/
101-
sudo apt-add-repository "deb http://apt.llvm.org/jammy/ llvm-toolchain-jammy-15 main"
101+
sudo apt-add-repository "deb http://apt.llvm.org/jammy/ llvm-toolchain-jammy-15 main"
102102
fi
103103
104104
sudo apt update
@@ -107,10 +107,6 @@ jobs:
107107
sudo apt install -y libicu-dev
108108
sudo apt install -y sqlite3
109109
110-
if [ "${{matrix.os}}" = "ubuntu-20.04" ]; then
111-
sudo apt install -y python3
112-
fi
113-
114110
if [ "${{matrix.compiler}}" = "gcc" ]; then
115111
sudo apt install -y g++-${{matrix.version}}
116112
echo "CC=gcc-${{matrix.version}}" >> $GITHUB_ENV

.github/workflows/macos-codeql.yml

Lines changed: 83 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,83 @@
1+
name: macos CodeQL
2+
3+
on: [workflow_dispatch]
4+
5+
jobs:
6+
7+
Build:
8+
name: ${{matrix.name}} (${{matrix.config}})
9+
runs-on: ${{matrix.os}}
10+
11+
env:
12+
CMAKE_GENERATOR: Ninja
13+
14+
strategy:
15+
fail-fast: false
16+
matrix:
17+
name: [
18+
macos-12-xcode-13-x86_64,
19+
# macos-12-xcode-13-arm64,
20+
macos-12-xcode-14-x86_64
21+
# macos-12-xcode-14-arm64
22+
]
23+
config: [Debug, Release]
24+
include:
25+
- name: macos-12-xcode-13-x86_64
26+
os: macos-12
27+
compiler: xcode
28+
version: "13.4"
29+
architecture: x86_64
30+
31+
# - name: macos-12-xcode-13-arm64
32+
# os: macos-12
33+
# compiler: xcode
34+
# version: "13.4"
35+
# architecture: arm64
36+
37+
- name: macos-12-xcode-14-x86_64
38+
os: macos-12
39+
compiler: xcode
40+
version: "14.2"
41+
architecture: x86_64
42+
43+
# - name: macos-12-xcode-14-arm64
44+
# os: macos-12
45+
# compiler: xcode
46+
# version: "14.2"
47+
# architecture: arm64
48+
49+
steps:
50+
- uses: actions/checkout@v3
51+
52+
- name: Dependencies
53+
run: |
54+
brew install ninja
55+
brew install doxygen graphviz
56+
brew install icu4c
57+
brew install sqlite
58+
59+
if [ "${{matrix.compiler}}" = "xcode" ]; then
60+
ls -ls /Applications/
61+
sudo xcode-select -switch /Applications/Xcode_${{matrix.version}}.app
62+
echo "CC=clang" >> $GITHUB_ENV
63+
echo "CXX=clang++" >> $GITHUB_ENV
64+
fi
65+
66+
- name: Initialize CodeQL
67+
uses: github/codeql-action/init@v2
68+
with:
69+
languages: 'cpp'
70+
71+
- name: Create Build Environment
72+
run: cmake -E make_directory ${{runner.workspace}}/build
73+
74+
- name: Configure CMake
75+
working-directory: ${{runner.workspace}}/build
76+
run: cmake $GITHUB_WORKSPACE -DCMAKE_BUILD_TYPE:STRING=${{matrix.config}} -DCMAKE_OSX_ARCHITECTURES:STRING=${{matrix.architecture}}
77+
78+
- name: Build
79+
working-directory: ${{runner.workspace}}/build
80+
run: cmake --build . --config ${{matrix.config}}
81+
82+
- name: Perform CodeQL Analysis
83+
uses: github/codeql-action/analyze@v2

.github/workflows/windows-codeql.yml

Lines changed: 101 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,101 @@
1+
name: windows CodeQL
2+
3+
on: [workflow_dispatch]
4+
5+
jobs:
6+
7+
Build:
8+
name: ${{matrix.name}} (${{matrix.config}})
9+
runs-on: ${{matrix.os}}
10+
11+
strategy:
12+
fail-fast: false
13+
matrix:
14+
name: [
15+
windows-2019-msvc2019,
16+
windows-2019-msvc2019-win32,
17+
# windows-2019-msvc2019-arm64,
18+
# windows-2019-msvc2019-clang,
19+
windows-2022-msvc2022,
20+
windows-2022-msvc2022-win32
21+
# windows-2022-msvc2022-arm64,
22+
# windows-2022-msvc2022-clang
23+
]
24+
config: [Debug, Release]
25+
include:
26+
- name: windows-2019-msvc2019
27+
os: windows-2019
28+
compiler: cl
29+
version: Visual Studio 16 2019
30+
architecture: -A x64
31+
32+
- name: windows-2019-msvc2019-win32
33+
os: windows-2019
34+
compiler: cl
35+
version: Visual Studio 16 2019
36+
architecture: -A Win32
37+
38+
# - name: windows-2019-msvc2019-arm64
39+
# os: windows-2019
40+
# compiler: cl
41+
# version: Visual Studio 16 2019
42+
# architecture: -A ARM64
43+
44+
# - name: windows-2019-msvc2019-clang
45+
# os: windows-2019
46+
# compiler: clang-cl
47+
# version: Visual Studio 16 2019
48+
# architecture: -A x64
49+
# toolchain: -T ClangCl
50+
51+
- name: windows-2022-msvc2022
52+
os: windows-2022
53+
compiler: cl
54+
version: Visual Studio 17 2022
55+
architecture: -A x64
56+
57+
- name: windows-2022-msvc2022-win32
58+
os: windows-2022
59+
compiler: cl
60+
version: Visual Studio 17 2022
61+
architecture: -A Win32
62+
63+
# - name: windows-2022-msvc2022-arm64
64+
# os: windows-2022
65+
# compiler: cl
66+
# version: Visual Studio 17 2022
67+
# architecture: -A ARM64
68+
69+
# - name: windows-2022-msvc2022-clang
70+
# os: windows-2022
71+
# compiler: clang-cl
72+
# version: Visual Studio 17 2022
73+
# architecture: -A x64
74+
# toolchain: -T ClangCl
75+
76+
steps:
77+
- uses: actions/checkout@v3
78+
79+
- name: Dependencies
80+
run: choco install doxygen.install graphviz -y
81+
82+
- name: Initialize CodeQL
83+
if: matrix.compiler != 'clang-cl'
84+
uses: github/codeql-action/init@v2
85+
with:
86+
languages: 'cpp'
87+
88+
- name: Create Build Environment
89+
run: cmake -E make_directory ${{runner.workspace}}/build
90+
91+
- name: Configure CMake
92+
working-directory: ${{runner.workspace}}/build
93+
run: cmake $env:GITHUB_WORKSPACE -DCMAKE_BUILD_TYPE:STRING=${{matrix.config}} -G"${{matrix.version}}" ${{matrix.architecture}} ${{matrix.toolchain}}
94+
95+
- name: Build
96+
working-directory: ${{runner.workspace}}/build
97+
run: cmake --build . --config ${{matrix.config}}
98+
99+
- name: Perform CodeQL Analysis
100+
if: matrix.compiler != 'clang-cl'
101+
uses: github/codeql-action/analyze@v2

CMakeLists.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ endif()
4545
project(sqlite_functions VERSION 0.1 DESCRIPTION "SQLite3 Functions" HOMEPAGE_URL "https://vxapps.com" LANGUAGES C CXX)
4646
include(${CMAKE_CURRENT_SOURCE_DIR}/cmake/env.cmake)
4747
include(${CMAKE}/checks.cmake)
48-
if(SQLITE_MASTER_PROJECT AND CMAKE_BUILD_TYPE STREQUAL "Debug")
48+
if(SQLITE_MASTER_PROJECT AND CMAKE_BUILD_TYPE STREQUAL Debug)
4949
include(${CMAKE}/sanitizers.cmake)
5050
endif()
5151

cmake/documentation.cmake

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -53,5 +53,5 @@ if(DOXYGEN_FOUND)
5353
WORKING_DIRECTORY ${CMAKE_SOURCE_DIR}
5454
COMMENT "Postprocessing documentation"
5555
DEPENDS documentation-generation
56-
VERBATIM)
57-
endif()
56+
VERBATIM)
57+
endif()

cmake/env.cmake

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -106,7 +106,7 @@ if(SQLITE_MASTER_PROJECT)
106106
include(CheckIPOSupported)
107107
check_ipo_supported(RESULT HAVE_IPO_SUPPORT OUTPUT IPO_ERROR)
108108
if(HAVE_IPO_SUPPORT)
109-
set(CMAKE_INTERPROCEDURAL_OPTIMIZATION ON)
109+
set(CMAKE_INTERPROCEDURAL_OPTIMIZATION ON)
110110
else()
111111
message(WARNING "IPO is not supported: ${IPO_ERROR}")
112112
endif()

cmake/external/googletest.cmake

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ include(ExternalProject)
3232

3333
set(GOOGLETEST_SRC ${CMAKE_BINARY_DIR}/_deps/googletest-src)
3434
set(GOOGLETEST_INSTALL ${CMAKE_BINARY_DIR}/_deps/googletest-install)
35-
if (UNIX)
35+
if(UNIX)
3636
set(GOOGLETEST_LIBRARY ${GOOGLETEST_INSTALL}/lib/libgtest.a)
3737
set(GOOGLETEST_OS_ARGS -DCMAKE_BUILD_TYPE:STRING=${CMAKE_BUILD_TYPE})
3838
else()

0 commit comments

Comments
 (0)
0