summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBent Bisballe Nyeng <deva@aasimon.org>2024-12-29 10:48:41 +0100
committerBent Bisballe Nyeng <deva@aasimon.org>2024-12-29 19:04:26 +0100
commit9c3cc6a8a51c4c4f01be7149d8522a713df2149a (patch)
tree434e403a7db672660bf192280d5b7a91cecf5039
parent15e2bd35a8da320f074942e814885f3d6eaf0706 (diff)
Enable mingw/gcc buildmingw
-rw-r--r--Jenkinsfile33
-rw-r--r--src/configure.cc4
-rw-r--r--src/tools.cc2
3 files changed, 33 insertions, 6 deletions
diff --git a/Jenkinsfile b/Jenkinsfile
index 3812aca..f0f5c6a 100644
--- a/Jenkinsfile
+++ b/Jenkinsfile
@@ -1,7 +1,32 @@
pipeline {
- agent any
+ agent { label 'linux' }
stages {
////////////////////////////////////////////////////
+ stage('Windows mingw') {
+ agent { label 'windows && mingw && c++20' }
+ environment
+ {
+ PATH="C:\\msys64\\ucrt64\\bin;C:\\msys64\\usr\\bin;${env.PATH}"
+ }
+ steps {
+ echo 'Cleaning workspace ...'
+ bat 'git clean -d -x -f'
+ echo 'Building (mingw) ...'
+ bat 'sh -c "CXX=g++ AR=ar ./bootstrap.sh"'
+ echo 'Testing (mingw) ...'
+ bat 'ctor check'
+ echo 'Testing suite (mingw) ...'
+ bat 'sh -c "(cd test/suite; CTORDIR=../../build CXX=g++ ./test.sh)"'
+ }
+ post {
+ always {
+ xunit(thresholds: [ skipped(failureThreshold: '0'),
+ failed(failureThreshold: '0') ],
+ tools: [ CppUnit(pattern: 'build/test/*.xml') ])
+ }
+ }
+ }
+ ////////////////////////////////////////////////////
stage('Linux gcc') {
agent { label 'linux && gcc && c++20' }
steps {
@@ -56,9 +81,11 @@ pipeline {
dir ('build/test') {
writeFile file:'dummy', text:''
}
- bat '"%VSDEVCMD%" && bootstrap.bat && snot.exe'
+ bat '"%VSDEVCMD%" && bootstrap.bat && ctor.exe'
echo 'Testing (msvc) ...'
- bat 'snot.exe check'
+ bat 'ctor.exe check'
+ echo 'Testing suite (msvc) ...'
+ bat '(cd test/suite; test.bat)'
}
post {
always {
diff --git a/src/configure.cc b/src/configure.cc
index d2c1053..da5dbfd 100644
--- a/src/configure.cc
+++ b/src/configure.cc
@@ -27,7 +27,7 @@ const std::filesystem::path configHeaderFile("config.h");
std::map<std::string, std::string> external_includedir;
std::map<std::string, std::string> external_libdir;
-#if !defined(_WIN32)
+#if !defined(_WIN32) || defined(__MINGW32__)
const ctor::configuration& __attribute__((weak)) ctor::get_configuration()
#else
const ctor::configuration& default_get_configuration()
@@ -49,7 +49,7 @@ const ctor::configuration& default_get_configuration()
}
return cfg;
}
-#if defined(_WIN32)
+#if defined(_WIN32) && !defined(__MINGW32__)
// Hack to make ctor::get_configuration "weak" linked
// See:
// https://stackoverflow.com/questions/2290587/gcc-style-weak-linking-in-visual-studio
diff --git a/src/tools.cc b/src/tools.cc
index 7f16a0e..4ae5f37 100644
--- a/src/tools.cc
+++ b/src/tools.cc
@@ -418,7 +418,7 @@ std::string get_arch([[maybe_unused]] ctor::output_system system)
{
std::string arch;
// TODO popen on windows
-#if !defined(_WIN32)
+#if !defined(_WIN32) || defined(__MINGW32__)
std::string cmd;
const auto& c = ctor::get_configuration();
switch(system)