-
Notifications
You must be signed in to change notification settings - Fork 182
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* add system property for cpm_add_subdirectory * add test case for system property * lock CMake version in test workflow * refactor to make SYSTEM an extra config option and update tests * remove old comment change * use consistent CMake version and extension for all workflows * make warning more specific and try to trigger on windows * another attempt to trigger warning on MSVC * update readme * simplify test case and use git tag * add SYSTEM option to .cmake-format * forward system arg for source overrides * enable system implicitly for the single argument syntax * Use SYSTEM option for FetchContent and add_subdirectory (#441) * Use SYSTEM option for FetchContent and add_subdirectory * Add SYSTEM option to syntax and doku * Update CPM.cmake * Update .cmake-format --------- Co-authored-by: Lars Melchior <[email protected]> --------- Co-authored-by: Claus Klein <[email protected]>
- Loading branch information
1 parent
0938e8f
commit 12daf36
Showing
9 changed files
with
100 additions
and
16 deletions.
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
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
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
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 |
---|---|---|
|
@@ -14,7 +14,12 @@ jobs: | |
runs-on: ubuntu-latest | ||
|
||
steps: | ||
- uses: actions/checkout@v1 | ||
- uses: actions/checkout@v3 | ||
|
||
- name: Setup cmake | ||
uses: jwlawson/[email protected] | ||
with: | ||
cmake-version: '3.25.x' | ||
|
||
- name: Install format dependencies | ||
run: pip3 install clang-format==14.0.6 cmake_format==0.6.11 pyyaml | ||
|
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 |
---|---|---|
|
@@ -20,7 +20,12 @@ jobs: | |
|
||
steps: | ||
- name: clone | ||
uses: actions/checkout@v2 | ||
uses: actions/checkout@v3 | ||
|
||
- name: Setup cmake | ||
uses: jwlawson/[email protected] | ||
with: | ||
cmake-version: '3.25.x' | ||
|
||
- name: unit tests | ||
run: | | ||
|
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
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
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
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,48 @@ | ||
require_relative './lib' | ||
|
||
class SystemWarnings < IntegrationTest | ||
|
||
def test_dependency_added_using_system | ||
for use_system in [true, false] do | ||
prj = make_project name: use_system ? "system" : "no_system", from_template: 'using-adder' | ||
prj.create_lists_from_default_template package: <<~PACK | ||
# this commit has a warning in a public header | ||
CPMAddPackage( | ||
NAME Adder | ||
GITHUB_REPOSITORY cpm-cmake/testpack-adder | ||
GIT_TAG v1.0.1-warnings | ||
SYSTEM #{use_system ? "YES" : "NO"} | ||
) | ||
# all packages using `adder` will error on warnings | ||
target_compile_options(adder INTERFACE | ||
$<$<CXX_COMPILER_ID:MSVC>:/Wall /WX> | ||
$<$<NOT:$<CXX_COMPILER_ID:MSVC>>:-Wall -Werror> | ||
) | ||
PACK | ||
|
||
assert_success prj.configure | ||
if use_system | ||
assert_success prj.build | ||
else | ||
assert_failure prj.build | ||
end | ||
end | ||
end | ||
|
||
def test_dependency_added_implicitly_using_system | ||
prj = make_project from_template: 'using-adder' | ||
prj.create_lists_from_default_template package: <<~PACK | ||
# this commit has a warning in a public header | ||
CPMAddPackage("gh:cpm-cmake/[email protected]") | ||
# all packages using `adder` will error on warnings | ||
target_compile_options(adder INTERFACE | ||
$<$<CXX_COMPILER_ID:MSVC>:/Wall /WX> | ||
$<$<NOT:$<CXX_COMPILER_ID:MSVC>>:-Wall -Werror> | ||
) | ||
PACK | ||
|
||
assert_success prj.configure | ||
assert_success prj.build | ||
end | ||
|
||
end |