Skip to content

Commit

Permalink
Build fixes for codeQL (#100)
Browse files Browse the repository at this point in the history
  • Loading branch information
adityapatwardhan authored Jul 25, 2024
1 parent 4481c68 commit c5e7725
Show file tree
Hide file tree
Showing 6 changed files with 22 additions and 18 deletions.
4 changes: 3 additions & 1 deletion .github/workflows/codeql-analysis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,9 @@ jobs:
name: Capture Environment
- run: |
tools/releaseBuild/vstsBuild.ps1 -Name 'centos.7' -Verbose
Import-Module ./build.psm1
Start-PSBootstrap
Start-BuildNativeUnixBinaries
name: Build
- name: Perform CodeQL Analysis
Expand Down
12 changes: 7 additions & 5 deletions build.psm1
Original file line number Diff line number Diff line change
Expand Up @@ -136,13 +136,15 @@ function Get-EnvironmentInformation
$environment += @{'IsUbuntu16' = $Environment.IsUbuntu -and $LinuxInfo.VERSION_ID -match '16.04'}
$environment += @{'IsUbuntu17' = $Environment.IsUbuntu -and $LinuxInfo.VERSION_ID -match '17.10'}
$environment += @{'IsUbuntu18' = $Environment.IsUbuntu -and $LinuxInfo.VERSION_ID -match '18.04'}
$environment += @{'IsUbuntu22' = $Environment.IsUbuntu -and $LinuxInfo.VERSION_ID -match '22.04'}
$environment += @{'IsCentOS' = $LinuxInfo.ID -match 'centos' -and $LinuxInfo.VERSION_ID -match '7'}
$environment += @{'IsFedora' = $LinuxInfo.ID -match 'fedora' -and $LinuxInfo.VERSION_ID -ge 24}
$environment += @{'IsRedHat' = $LinuxInfo.ID -match 'rhel'}
$environment += @{'IsOpenSUSE' = $LinuxInfo.ID -match 'opensuse'}
$environment += @{'IsSLES' = $LinuxInfo.ID -match 'sles'}
$environment += @{'IsOpenSUSE13' = $Environmenst.IsOpenSUSE -and $LinuxInfo.VERSION_ID -match '13'}
$environment += @{'IsOpenSUSE42.1' = $Environment.IsOpenSUSE -and $LinuxInfo.VERSION_ID -match '42.1'}
$environment += @{'IsRedHatFamily' = $Environment.IsCentOS -or $Environment.IsFedora}
$environment += @{'IsRedHatFamily' = $Environment.IsCentOS -or $Environment.IsFedora -or $Environment.IsRedHat}
$environment += @{'IsSUSEFamily' = $Environment.IsSLES -or $Environment.IsOpenSUSE}
$environment += @{'IsAlpine' = $LinuxInfo.ID -match 'alpine'}

Expand Down Expand Up @@ -1891,7 +1893,7 @@ function Install-Dotnet {
}

function Get-RedHatPackageManager {
if ($Environment.IsCentOS) {
if ($Environment.IsCentOS -or $Environment.IsRedHat) {
"yum install -y -q"
} elseif ($Environment.IsFedora) {
"dnf install -y -q"
Expand Down Expand Up @@ -1978,13 +1980,13 @@ function Start-PSBootstrap {
}
} elseif ($Environment.IsRedHatFamily) {
# Build tools
$Deps += "which", "curl", "gcc-c++", "cmake", "make"
$Deps += "which", "curl", "wget"

# .NET Core required runtime libraries
$Deps += "libicu", "libunwind"
$Deps += "libicu", "openssl-libs"

# Packaging tools
if ($Package) { $Deps += "ruby-devel", "rpm-build", "groff", 'libffi-devel' }
if ($Package) { $Deps += "ruby-devel", "rpm-build", "groff", 'libffi-devel', "gcc-c++" }

$PackageManager = Get-RedHatPackageManager

Expand Down
6 changes: 3 additions & 3 deletions src/libpsl-native/gmock.pc
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
libdir=/usr/local/lib
libdir=/usr/local/lib64
includedir=/usr/local/include

Name: gmock
Description: GoogleMock (without main() function)
Version: 1.9.0
URL: https://github.com/google/googletest
Libs: -L${libdir} -lgmock
Cflags: -I${includedir} -DGTEST_HAS_PTHREAD=1
Libs: -L${libdir} -lgmock -pthread
Cflags: -I${includedir} -DGTEST_HAS_PTHREAD=1 -pthread
6 changes: 3 additions & 3 deletions src/libpsl-native/gmock_main.pc
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
libdir=/usr/local/lib
libdir=/usr/local/lib64
includedir=/usr/local/include

Name: gmock_main
Description: GoogleMock (with main() function)
Version: 1.9.0
URL: https://github.com/google/googletest
Libs: -L${libdir} -lgmock_main
Cflags: -I${includedir} -DGTEST_HAS_PTHREAD=1
Libs: -L${libdir} -lgmock_main -pthread
Cflags: -I${includedir} -DGTEST_HAS_PTHREAD=1 -pthread
6 changes: 3 additions & 3 deletions src/libpsl-native/gtest.pc
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
libdir=/usr/local/lib
libdir=/usr/local/lib64
includedir=/usr/local/include

Name: gtest
Description: GoogleTest (without main() function)
Version: 1.9.0
URL: https://github.com/google/googletest
Libs: -L${libdir} -lgtest
Cflags: -I${includedir} -DGTEST_HAS_PTHREAD=1
Libs: -L${libdir} -lgtest -pthread
Cflags: -I${includedir} -DGTEST_HAS_PTHREAD=1 -pthread
6 changes: 3 additions & 3 deletions src/libpsl-native/gtest_main.pc
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
libdir=/usr/local/lib
libdir=/usr/local/lib64
includedir=/usr/local/include

Name: gtest_main
Description: GoogleTest (with main() function)
Version: 1.9.0
URL: https://github.com/google/googletest
Requires: gtest
Libs: -L${libdir} -lgtest_main
Cflags: -I${includedir} -DGTEST_HAS_PTHREAD=1
Libs: -L${libdir} -lgtest_main -pthread
Cflags: -I${includedir} -DGTEST_HAS_PTHREAD=1 -pthread

0 comments on commit c5e7725

Please sign in to comment.