cristianadam / helloworld Goto Github PK
View Code? Open in Web Editor NEWA C++ Hello World project, using CMake, and GitHub Actions
License: MIT License
A C++ Hello World project, using CMake, and GitHub Actions
License: MIT License
Cache not found for input keys: Windows Latest MSVC-ccache-2022-04-07-14;27;45, Windows Latest MSVC-ccache-
This project currently doesn't include a LICENSE
file, nor is there information about licensing inside the READMT.md
. As a result, it is currently all-rights-reserved, and other people cannot download and use it legally.
Thank you for creating this great project! It would be cool if it can be distributed under an open source license.
I'm working on the CMake tooling of Nixpkgs (the official repository of a cross-platform package manager Nix), and plans to add some test packages for the CI. This project would be a great test target if it could be distributed under an open-source license.
People are trying to contribute via pull requests (#3). It requires a license to create a clean ground of contributions. An all-rights-reserved project merging an all-rights-reserved PR will results in a mixture that no one can use legally.
Dear cristianadam
Thank you for sharing this project, this project is very useful to me. How can I extend this project to other platforms?
For example, I want to compile the HelloWorld library including (ios, android(arm64-v8a,armeabi-v7a), windows (x86_64, x64), linux, macos, Raspberry Pi)
Thanks!
Hello,
we are using the basic build script here to run our post merge testing on MSVC for https://github.com/gromacs/gromacs and it is been working fine.
Since the default wndows-latest environment changed to windows-2022, the compiler lookup fails (see here for an example failing build: https://github.com/gromacs/gromacs/runs/5229802627?check_suite_focus=true). I just wanted to let you know about the issue in case you are planning to update the files here.
Thanks for the helpful tool!
Cheers
Paul
main.yml file.
I just followed the above document to create qt shared library.
I compiled this project with mac in github actions. the compilation done in mac and linux with github action.
If I comes to windows it occured an errors.
collect2.exe: error: ld returned 1 exit status
How can I solve this error ?
Help me !!!
I am using the example from gtest docs:
Here is my toplevel CMakeLists.txt:
cmake_minimum_required(VERSION 3.24)
project(
test_mingw
VERSION 0.1.0
HOMEPAGE_URL ""
LANGUAGES CXX
)
set(CMAKE_CXX_STANDARD 17)
include(FetchContent)
FetchContent_Declare(
googletest
URL https://github.com/google/googletest/archive/03597a01ee50ed33e9dfd640b249b4be3799d395.zip
)
# For Windows: Prevent overriding the parent project's compiler/linker settings
set(gtest_force_shared_crt ON CACHE BOOL "" FORCE)
FetchContent_MakeAvailable(googletest)
add_executable(
hello_test
src/hello_test.cc
)
target_link_libraries(
hello_test
GTest::gtest_main
)
include(GoogleTest)
gtest_discover_tests(hello_test)
hello_test.cc:
#include <gtest/gtest.h>
TEST(HelloTest, BasicAssertions) {
// Expect two strings not to be equal.
EXPECT_STRNE("hello", "world");
// Expect equality.
EXPECT_EQ(7 * 6, 42);
}
int main(int argc, char **argv)
{
testing::InitGoogleTest(&argc, argv);
return RUN_ALL_TESTS();
}
It builds fine on Windows MSVC, Macos Clang, Linux GCC, but fails using Mingw GCC, here is error shown:
FAILED: hello_test.exe hello_test[1]_tests.cmake D:/a/tsst/tsst/build/hello_test[1]_tests.cmake
cmd.exe /C "cd . && C:\ProgramData\chocolatey\bin\g++.exe -O3 -DNDEBUG CMakeFiles/hello_test.dir/src/hello_test.cc.obj -o hello_test.exe -Wl,--out-implib,libhello_test.dll.a -Wl,--major-image-version,0,--minor-image-version,0 lib/libgtest_main.a lib/libgtest.a -lkernel32 -luser32 -lgdi32 -lwinspool -lshell32 -lole32 -loleaut32 -luuid -lcomdlg32 -ladvapi32 && cmd.exe /C "cd /D D:\a\tsst\tsst\build && D:\a\tsst\tsst\cmake-3.24.3-windows-x86_64\bin\cmake.exe -D TEST_TARGET=hello_test -D TEST_EXECUTABLE=D:/a/tsst/tsst/build/hello_test.exe -D TEST_EXECUTOR= -D TEST_WORKING_DIR=D:/a/tsst/tsst/build -D TEST_EXTRA_ARGS= -D TEST_PROPERTIES= -D TEST_PREFIX= -D TEST_SUFFIX= -D TEST_FILTER= -D NO_PRETTY_TYPES=FALSE -D NO_PRETTY_VALUES=FALSE -D TEST_LIST=hello_test_TESTS -D CTEST_FILE=D:/a/tsst/tsst/build/hello_test[1]_tests.cmake -D TEST_DISCOVERY_TIMEOUT=5 -D TEST_XML_OUTPUT_DIR= -P D:/a/tsst/tsst/cmake-3.24.3-windows-x86_64/share/cmake-3.24/Modules/GoogleTestAddTests.cmake""
CMake Error at D:/a/tsst/tsst/cmake-3.24.3-windows-x86_64/share/cmake-3.24/Modules/GoogleTestAddTests.cmake:112 (message):
Error running test executable.
Path: 'D:/a/tsst/tsst/build/hello_test.exe'
Result: Exit code 0xc0000139
Output:
Call Stack (most recent call first):
D:/a/tsst/tsst/cmake-3.24.3-windows-x86_64/share/cmake-3.24/Modules/GoogleTestAddTests.cmake:225 (gtest_discover_tests_impl)
ninja: build stopped: subcommand failed.
Build works fine without building gtest, and it fails when building test executable with gtest
When I set the job directory using
defaults:
run:
working-directory: ./ARM_Lite_Compiler
the action fails in Configure
, which yields
CMake Error at CMakeLists.txt:3 (PROJECT):
Running
'ninja' '--version'
failed with:
No such file or directory
CMake Error: CMAKE_C_COMPILER not set, after EnableLanguage
CMake Error: CMAKE_CXX_COMPILER not set, after EnableLanguage
-- Configuring incomplete, errors occurred!
See also "/home/runner/work/ARM_Lite/ARM_Lite/ARM_Lite_Compiler/build/CMakeFiles/CMakeOutput.log".
CMake Error at /home/runner/work/_temp/5f649009-61c2-41ed-8dbc-2bbb832adf25:32 (message):
Bad exit status
Error: Process completed with exit code 1.
The work I am doing is here.
When we use release tag:
add changes
closed issues
commits between current and previous version
add release file hash
Reference:
Any way to incorporate this amazing action to allow it to do a nightly build system, maybe something similar to https://github.com/marvinpinto/actions/tree/master/packages/automatic-releases
Would you accept a PR that does these things:
env:
yaml block instead of cmake script- run: ccache -s
instead of cmake scriptgithub.run_id
for cache instead of cmake script current time (plays nicer with job retry)BTW: thank you so much for the clear article and example code here, it's been so useful.
Wrong place, but where to report it? I am not a paying customer. Found no way to report it.
Hbnmmd
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.