-
Notifications
You must be signed in to change notification settings - Fork 611
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Showing
291 changed files
with
28,869 additions
and
0 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
project(catch2) | ||
|
||
include(CompileWarnings) | ||
|
||
file( | ||
GLOB_RECURSE catch2_src | ||
src/main/native/cpp/*.cpp | ||
) | ||
|
||
add_library(catch2 ${catch2_src}) | ||
set_target_properties(catch2 PROPERTIES DEBUG_POSTFIX "d") | ||
|
||
set_property(TARGET catch2 PROPERTY FOLDER "libraries") | ||
target_compile_features(catch2 PUBLIC cxx_std_20) | ||
|
||
set(CATCH_CONFIG_DEFAULT_REPORTER "console" CACHE STRING "Read docs/configuration.md for details. The name of the reporter should be without quotes.") | ||
set(CATCH_CONFIG_CONSOLE_WIDTH "80" CACHE STRING "Read docs/configuration.md for details. Must form a valid integer literal.") | ||
|
||
include_directories( | ||
"${CMAKE_CURRENT_SOURCE_DIR}/src/main/native/include" | ||
) | ||
|
||
configure_file( | ||
"src/main/native/include/catch2/catch_user_config.hpp.in" | ||
"${CMAKE_CURRENT_BINARY_DIR}/generated-includes/catch2/catch_user_config.hpp" | ||
) | ||
|
||
target_include_directories( | ||
catch2 | ||
PUBLIC | ||
$<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/src/main/native/include> | ||
$<BUILD_INTERFACE:${PROJECT_BINARY_DIR}/generated-includes> | ||
) | ||
|
||
wpilib_target_warnings(catch2) | ||
|
||
install(TARGETS catch2 EXPORT catch2) | ||
export(TARGETS catch2 FILE catch2.cmake NAMESPACE Catch::) |
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,66 @@ | ||
apply plugin: 'cpp' | ||
apply plugin: 'visual-studio' | ||
apply plugin: 'edu.wpi.first.NativeUtils' | ||
|
||
ext { | ||
nativeName = 'Catch2' | ||
} | ||
|
||
apply from: "${rootDir}/shared/config.gradle" | ||
|
||
def catch2UserConfigInput = file("src/main/native/include/catch2/catch_user_config.hpp.in") | ||
def catch2UserConfigOutput = file("$buildDir/generated-includes/catch2/catch_user_config.hpp") | ||
|
||
task generateCatchUserConfig() { | ||
description = 'Generates the Catch2 user config file.' | ||
group = 'Catch2' | ||
|
||
outputs.file catch2UserConfigOutput | ||
inputs.file catch2UserConfigInput | ||
|
||
doLast { | ||
println "Writing config to $catch2UserConfigOutput" | ||
|
||
if (catch2UserConfigOutput.exists()) { | ||
catch2UserConfigOutput.delete() | ||
} | ||
|
||
def read = catch2UserConfigInput.text | ||
read.replace('${CATCH_CONFIG_DEFAULT_REPORTER}', "console") | ||
read.replace('${CATCH_CONFIG_CONSOLE_WIDTH}', "80") | ||
|
||
catch2UserConfigOutput.write(read) | ||
} | ||
} | ||
|
||
model { | ||
components { | ||
"${nativeName}"(NativeLibrarySpec) { | ||
sources.cpp { | ||
source { | ||
srcDirs "src/main/native/cpp/**/*.cpp" | ||
include '*.cpp' | ||
} | ||
exportedHeaders { | ||
srcDirs 'src/main/native/include', | ||
"$buildDir/generated-includes/" | ||
} | ||
} | ||
binaries { | ||
all { | ||
tasks.withType(CppCompile) { | ||
dependsOn generateCatchUserConfig | ||
} | ||
} | ||
} | ||
} | ||
binaries { | ||
all { | ||
tasks.withType(CppCompile) { | ||
dependsOn generateCatchUserConfig | ||
} | ||
} | ||
} | ||
} | ||
|
||
apply from: 'publish.gradle' |
Oops, something went wrong.