Loading .gitlab-ci.yml +0 −6 Original line number Diff line number Diff line Loading @@ -15,18 +15,12 @@ stages: - ./hello_world.exe .mac_template: &mac variables: COMPILERS: gnu,clang tags: - mac environment: mac .xk7_template: &xk7 variables: COMPILERS: gnu,pgi,cce,intel tags: - xk7 environment: xk7 build:mac: <<: *build Loading Breakfile.py +14 −1 Original line number Diff line number Diff line from breakable import * import platform class BreakTasks(object): CC = which("c++") @provides("hello_world.exe") def build_hello_world(self): Loading @@ -10,3 +10,16 @@ class BreakTasks(object): def clean(self): rm("*.exe") @belhorn_property def CC(self): if platform.system() == 'Linux': return self._linux_cc() else: return self._mac_cc() def _linux_cc(self): return which("CC") def _mac_cc(self): return which("c++") main.cpp +2 −1 Original line number Diff line number Diff line #include <iostream> #include "platform.h" int main(int argc, char** argv) { std::cout << "Hello, World!\n"; std::cout << "Hello from " << PLATFORM << "\n"; } platform.h 0 → 100644 +7 −0 Original line number Diff line number Diff line #ifdef __APPLE__ #define PLATFORM "OSX" #endif #ifdef __linux__ #define PLATFORM "LINUX" #endif Loading
.gitlab-ci.yml +0 −6 Original line number Diff line number Diff line Loading @@ -15,18 +15,12 @@ stages: - ./hello_world.exe .mac_template: &mac variables: COMPILERS: gnu,clang tags: - mac environment: mac .xk7_template: &xk7 variables: COMPILERS: gnu,pgi,cce,intel tags: - xk7 environment: xk7 build:mac: <<: *build Loading
Breakfile.py +14 −1 Original line number Diff line number Diff line from breakable import * import platform class BreakTasks(object): CC = which("c++") @provides("hello_world.exe") def build_hello_world(self): Loading @@ -10,3 +10,16 @@ class BreakTasks(object): def clean(self): rm("*.exe") @belhorn_property def CC(self): if platform.system() == 'Linux': return self._linux_cc() else: return self._mac_cc() def _linux_cc(self): return which("CC") def _mac_cc(self): return which("c++")
main.cpp +2 −1 Original line number Diff line number Diff line #include <iostream> #include "platform.h" int main(int argc, char** argv) { std::cout << "Hello, World!\n"; std::cout << "Hello from " << PLATFORM << "\n"; }
platform.h 0 → 100644 +7 −0 Original line number Diff line number Diff line #ifdef __APPLE__ #define PLATFORM "OSX" #endif #ifdef __linux__ #define PLATFORM "LINUX" #endif