-
Notifications
You must be signed in to change notification settings - Fork 980
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
Support shared library build #686
Open
uilianries
wants to merge
11
commits into
ThrowTheSwitch:master
Choose a base branch
from
uilianries:feature/shared-library
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
Show all changes
11 commits
Select commit
Hold shift + click to select a range
c6b7bbe
Support shared library build
uilianries 4ca66a2
build for any branch
uilianries b05426f
Use python to install deps
uilianries 70c3c71
Add shared build
uilianries 856ac8a
Use real bool
uilianries ab52acb
Prepare Windows environment
uilianries 747d0ab
enable extensions
uilianries 3f1d569
use msvc generator for windows
uilianries 63cfdd1
skip default runner
uilianries e38bce4
manage skip defult runner
uilianries 11e95e2
manage skip defult runner
uilianries File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,106 @@ | ||
--- | ||
name: Build Unity library | ||
|
||
on: | ||
push: | ||
pull_request: | ||
|
||
jobs: | ||
build: | ||
name: ${{ matrix.config.name }} | ||
runs-on: ${{ matrix.config.os }} | ||
strategy: | ||
fail-fast: false | ||
matrix: | ||
config: | ||
- { | ||
name: "Windows: MSVC - Release Static", | ||
os: windows-latest, | ||
build_type: "Release", | ||
cc: "cl", | ||
cxx: "cl", | ||
environment_script: "C:/Program Files (x86)/Microsoft Visual Studio/2022/Enterprise/VC/Auxiliary/Build/vcvars64.bat", | ||
generators: "Visual Studio 17 2022", | ||
shared_build: false | ||
} | ||
- { | ||
name: "Ubuntu: GCC - Release Static", | ||
os: ubuntu-latest, | ||
build_type: "Release", | ||
cc: "gcc", | ||
cxx: "g++", | ||
generators: "Ninja", | ||
shared_build: false | ||
} | ||
- { | ||
name: "Apple OSX: Clang - Release Static", | ||
os: macos-latest, | ||
build_type: "Release", | ||
cc: "clang", | ||
cxx: "clang++", | ||
generators: "Ninja", | ||
shared_build: false | ||
} | ||
- { | ||
name: "Windows: MSVC - Release Shared", | ||
os: windows-latest, | ||
build_type: "Release", | ||
cc: "cl", | ||
cxx: "cl", | ||
environment_script: "C:/Program Files (x86)/Microsoft Visual Studio/2022/Enterprise/VC/Auxiliary/Build/vcvars64.bat", | ||
generators: "Visual Studio 17 2022", | ||
shared_build: true | ||
} | ||
- { | ||
name: "Ubuntu: GCC - Release Shared", | ||
os: ubuntu-latest, | ||
build_type: "Release", | ||
cc: "gcc", | ||
cxx: "g++", | ||
generators: "Ninja", | ||
shared_build: true | ||
} | ||
- { | ||
name: "Apple OSX: Clang - Release Shared", | ||
os: macos-latest, | ||
build_type: "Release", | ||
cc: "clang", | ||
cxx: "clang++", | ||
generators: "Ninja", | ||
shared_build: true | ||
} | ||
|
||
steps: | ||
- uses: actions/checkout@v3 | ||
- uses: actions/setup-python@v4 | ||
with: | ||
python-version: 3.8 | ||
|
||
- name: Install dependencies | ||
run: pip install cmake ninja | ||
|
||
- name: Prepare Visual Studio environment | ||
if: startsWith(matrix.config.os, 'windows') | ||
run: cmd "${{ matrix.config.environment_script }}" | ||
|
||
- name: CMake configure | ||
shell: bash | ||
run: | | ||
cmake \ | ||
-S . \ | ||
-B build \ | ||
-DCMAKE_BUILD_TYPE=${{ matrix.config.build_type }} \ | ||
-G "${{ matrix.config.generators }}" \ | ||
-DCMAKE_INSTALL_PREFIX:PATH=install \ | ||
-DBUILD_SHARED_LIBS:BOOL=${{ matrix.config.shared_build }} \ | ||
-DCMAKE_VERBOSE_MAKEFILE:BOOL=ON \ | ||
-DUNITY_EXTENSION_FIXTURES:BOOL=ON \ | ||
-DUNITY_EXTENSION_MEMORY:BOOL=ON | ||
|
||
- name: CMake build | ||
shell: bash | ||
run: cmake --build build --config ${{ matrix.config.build_type }} | ||
|
||
- name: CMake install | ||
shell: bash | ||
run: cmake --build build --config ${{ matrix.config.build_type }} --target install |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What about adding option for
BUILD_SHARED_LIBS
, as described in cmake docs?