Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Explicitly set target linker language for compat CMakeLists.txt #33

Merged
merged 2 commits into from
Mar 31, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
24 changes: 21 additions & 3 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,12 @@ on:
jobs:
build-linux:
runs-on: ubuntu-latest

strategy:
fail-fast: false
matrix:
generator: ["Unix Makefiles", Ninja]

steps:
# Install latest CMake.
- uses: lukka/get-cmake@latest
Expand All @@ -30,7 +36,7 @@ jobs:
- name: CMake
run: |
mkdir cbuild
cmake -S . -B cbuild/ -DBUILD_EXAMPLES=TRUE
cmake -S . -B cbuild/ -DBUILD_EXAMPLES=TRUE -G "${{ matrix.generator }}"
cmake --build cbuild/
- uses: ruby/setup-ruby@v1
Expand All @@ -56,6 +62,12 @@ jobs:
build-windows:
# Because we want to use Visual Studio 16 2019, we need to use the windows-2019 GitHub runner
runs-on: windows-2019

strategy:
fail-fast: false
matrix:
generator: ["Visual Studio 16 2019", Ninja]

steps:
# Install latest CMake.
- uses: lukka/get-cmake@latest
Expand All @@ -64,14 +76,19 @@ jobs:
with:
submodules: recursive

- name: Add cl.exe to PATH
uses: ilammy/msvc-dev-cmd@v1
with:
arch: amd64

- name: CMake
run: |
# make a build directory (note: build is already used by Crashpad)
mkdir cbuild
# run CMake (additional options like -DCMAKE_EXPORT_COMPILE_COMMANDS=TRUE are possible)
# it is recommended to specify the compiler version used for the build
cmake -S . -B cbuild/ -DBUILD_EXAMPLES=TRUE -G "Visual Studio 16 2019"
cmake -S . -B cbuild/ -DBUILD_EXAMPLES=TRUE -G "${{ matrix.generator }}" -DCMAKE_CXX_COMPILER=cl.exe -DCMAKE_C_COMPILER=cl.exe
cmake --build cbuild/
- uses: ruby/setup-ruby@v1
Expand Down Expand Up @@ -101,6 +118,7 @@ jobs:
fail-fast: false
matrix:
arch: [arm64, x86_64]
generator: ["Unix Makefiles", Ninja]

steps:
# Install latest CMake.
Expand All @@ -113,7 +131,7 @@ jobs:
- name: CMake
run: |
mkdir cbuild
cmake -S . -B cbuild/ -DBUILD_EXAMPLES=TRUE -DCMAKE_OSX_ARCHITECTURES=${{ matrix.arch }}
cmake -S . -B cbuild/ -DBUILD_EXAMPLES=TRUE -DCMAKE_OSX_ARCHITECTURES=${{ matrix.arch }} -G "${{ matrix.generator }}"
cmake --build cbuild/
- uses: ruby/setup-ruby@v1
Expand Down
10 changes: 6 additions & 4 deletions backtrace/save_artifacts.rb
Original file line number Diff line number Diff line change
Expand Up @@ -51,8 +51,8 @@ def gather_include_files dir = include_dir
selected_headers = all_headers
.reject{ _1 =~ /^#{Regexp.union REJECT_DIRS}/ }
.map{ [ "include/#{_1}", File.absolute_path(_1) ] }


selected_headers += Dir.chdir 'third_party/mini_chromium/mini_chromium' do
Dir['**/*.h']
.map{ [ "include/#{_1}", File.absolute_path(_1) ] }
Expand Down Expand Up @@ -82,9 +82,11 @@ def gather_binaries dir = binary_dir
[ 'client/libclient.a', 'bin/libclient.a' ],
[ 'handler/handler', 'bin/handler' ],
[ './client/Debug/client.lib', 'bin/client.lib' ],
[ 'handler\Debug\handler.exe', 'bin/handler.exe' ],
[ 'handler/Debug/handler.exe', 'bin/handler.exe' ],
[ './client/Release/client.lib', 'bin/client.lib' ],
[ 'handler\Release\handler.exe', 'bin/handler.exe' ],
[ 'handler/Release/handler.exe', 'bin/handler.exe' ],
[ './client/client.lib', 'bin/client.lib' ],
[ 'handler/handler.exe', 'bin/handler.exe' ],
]
Dir.chdir dir do
files.each do |file, name|
Expand Down
6 changes: 5 additions & 1 deletion backtrace/test/crashpad_utils.rb
Original file line number Diff line number Diff line change
Expand Up @@ -117,7 +117,11 @@ def execute tmp_dir: nil

def handler
if OS.windows?
'handler/Debug/handler.exe'
[
'handler/Debug/handler.exe',
'handler/Release/handler.exe',
'handler/handler.exe',
].find { |f| File.exist? f }
else
'handler/handler'
end
Expand Down
10 changes: 8 additions & 2 deletions backtrace/test/test_windows.rb
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,15 @@

require_relative 'crashpad_utils'

class TestLinux < Minitest::Test
class TestWindows < Minitest::Test
def test_crashpad_uploads
result = Crashpad::perform_test executable: 'examples/windows/demo/Debug/demo_windows.exe'
exe = if File.exist?("#{__dir__}/../../cbuild/examples/windows/demo/Debug/demo_windows.exe")
'examples/windows/demo/Debug/demo_windows.exe'
else
'examples/windows/demo/demo_windows.exe'
end

result = Crashpad::perform_test executable: exe
assert result
assert result.has_key? :upload

Expand Down
1 change: 1 addition & 0 deletions compat/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,7 @@ endif (WIN32)

add_library(compat_incl INTERFACE)
add_library(compat OBJECT)
set_target_properties(compat PROPERTIES LINKER_LANGUAGE CXX)

target_sources(compat PRIVATE ${CRASHPAD_COMPAT_LIBRARY_FILES})
target_link_libraries(compat PUBLIC util compat_incl)
Expand Down