Unnamed: 0
int64
0
0
repo_id
stringlengths
5
186
file_path
stringlengths
15
223
content
stringlengths
1
32.8M
0
repos/xmake/tests/projects/c++/modules
repos/xmake/tests/projects/c++/modules/partitions/xmake.lua
add_rules("mode.release", "mode.debug") set_languages("c++20") target("partition") set_kind("binary") add_files("src/*.cpp", "src/*.mpp")
0
repos/xmake/tests/projects/c++/modules/partitions
repos/xmake/tests/projects/c++/modules/partitions/src/main.cpp
#include <iostream> import math; int main() { std::cout << std::endl; std::cout << "add(3, 4): " << add(3, 4) << std::endl; std::cout << "mul(3, 4): " << mul(3, 4) << std::endl; }
0
repos/xmake/tests/projects/c++/modules
repos/xmake/tests/projects/c++/modules/hello with spaces/test.lua
inherit(".test_base")
0
repos/xmake/tests/projects/c++/modules
repos/xmake/tests/projects/c++/modules/hello with spaces/xmake.lua
add_rules("mode.release", "mode.debug") set_languages("c++20") target("hello with spaces") set_kind("binary") add_files("src/*.cpp", "src/*.mpp")
0
repos/xmake/tests/projects/c++/modules/hello with spaces
repos/xmake/tests/projects/c++/modules/hello with spaces/src/main.cpp
import hello; int main() { hello::say("hello module!"); return 0; }
0
repos/xmake/tests/projects/c++/modules
repos/xmake/tests/projects/c++/modules/stl_headerunit/test.lua
inherit(".test_headerunits")
0
repos/xmake/tests/projects/c++/modules
repos/xmake/tests/projects/c++/modules/stl_headerunit/xmake.lua
add_rules("mode.release", "mode.debug") set_languages("c++20") target("stl_headerunit") set_kind("binary") add_files("src/*.cpp", "src/*.mpp")
0
repos/xmake/tests/projects/c++/modules/stl_headerunit
repos/xmake/tests/projects/c++/modules/stl_headerunit/src/main.cpp
import hello; int main() { hello::say("hello module!"); return 0; }
0
repos/xmake/tests/projects/c++/modules
repos/xmake/tests/projects/c++/modules/duplicate_name_detection/test.lua
import("lib.detect.find_tool") import("core.base.semver") import("utils.ci.is_running", {alias = "ci_is_running"}) function _build() try { function() if ci_is_running() then os.run("xmake -rvD") else os.run("xmake -r") end end, catch { function (errors) errors = tostring(errors) if not errors:find("duplicate module name detected", 1, true) then raise("Modules duplicate name detection does not work\n%s", errors) end end } } end function can_build() if is_subhost("windows") then return true elseif is_subhost("msys") then return true elseif is_host("linux") then local gcc = find_tool("gcc", {version = true}) if gcc and gcc.version and semver.compare(gcc.version, "11.0") >= 0 then return true end local clang = find_tool("clang", {version = true}) if clang and clang.version and semver.compare(clang.version, "14.0") >= 0 then return true end end end function main(t) if is_subhost("windows") then local clang = find_tool("clang", {version = true}) if clang and clang.version and semver.compare(clang.version, "17.0") >= 0 then os.exec("xmake f --toolchain=clang -c --yes") _build() os.exec("xmake clean -a") os.exec("xmake f --toolchain=clang --runtimes=c++_shared -c --yes") _build() end os.exec("xmake clean -a") os.exec("xmake f -c --yes") _build() elseif is_subhost("msys") then os.exec("xmake f -c -p mingw --yes") _build() elseif is_host("linux") then local gcc = find_tool("gcc", {version = true}) if gcc and gcc.version and semver.compare(gcc.version, "11.0") >= 0 then os.exec("xmake f -c --yes") _build() end local clang = find_tool("clang", {version = true}) if clang and clang.version and semver.compare(clang.version, "14.0") >= 0 then os.exec("xmake clean -a") os.exec("xmake f --toolchain=clang -c --yes") _build() os.exec("xmake clean -a") os.exec("xmake f --toolchain=clang --runtimes=c++_shared -c --yes") _build() end end end
0
repos/xmake/tests/projects/c++/modules
repos/xmake/tests/projects/c++/modules/duplicate_name_detection/xmake.lua
add_rules("mode.release", "mode.debug") set_languages("c++20") target("foo") set_kind("moduleonly") add_files("src/foo.mpp") target("bar") set_kind("moduleonly") add_files("src/bar.mpp") target("duplicate_name_detection_1") set_kind("binary") add_deps("foo", "bar") add_files("src/main.cpp") target("duplicate_name_detection_2") set_kind("binary") add_deps("bar", "foo") add_files("src/main.cpp")
0
repos/xmake/tests/projects/c++/modules/duplicate_name_detection
repos/xmake/tests/projects/c++/modules/duplicate_name_detection/src/main.cpp
import foo; int main() { return value(); }
0
repos/xmake/tests/projects/c++/modules
repos/xmake/tests/projects/c++/modules/ifdef_module/test.lua
inherit(".test_base")
0
repos/xmake/tests/projects/c++/modules
repos/xmake/tests/projects/c++/modules/ifdef_module/xmake.lua
add_rules("mode.release", "mode.debug") set_languages("c++20") target("ifdef_module") set_kind("binary") add_files("src/*.cpp") set_policy("build.c++.modules", true)
0
repos/xmake/tests/projects/c++/modules/ifdef_module
repos/xmake/tests/projects/c++/modules/ifdef_module/src/main.cpp
#ifdef FOO import hello; #endif int main() { return 0; }
0
repos/xmake/tests/projects/c++/modules
repos/xmake/tests/projects/c++/modules/moduleonly/test.lua
inherit(".test_base")
0
repos/xmake/tests/projects/c++/modules
repos/xmake/tests/projects/c++/modules/moduleonly/xmake.lua
add_rules("mode.release", "mode.debug") set_languages("c++20") target("mod") set_kind("moduleonly") add_files("src/mod.mpp")
0
repos/xmake/tests/projects/c++/modules
repos/xmake/tests/projects/c++/modules/internal_partition/test.lua
inherit(".test_base")
0
repos/xmake/tests/projects/c++/modules
repos/xmake/tests/projects/c++/modules/internal_partition/xmake.lua
add_rules("mode.release", "mode.debug") set_languages("c++20") target("internal_partition") set_kind("binary") add_files("src/*.cpp", "src/hello.mpp") add_files("src/hello_internal.mpp")
0
repos/xmake/tests/projects/c++/modules/internal_partition
repos/xmake/tests/projects/c++/modules/internal_partition/src/main.cpp
import hello; int main() { hello::say("hello module!"); return 0; }
0
repos/xmake/tests/projects/c++/modules
repos/xmake/tests/projects/c++/modules/culling2/test.lua
import("lib.detect.find_tool") import("core.base.semver") import("utils.ci.is_running", {alias = "ci_is_running"}) function _build() local outdata if ci_is_running() then outdata = os.iorun("xmake -rvD") else outdata = os.iorun("xmake -rv") end if outdata then if outdata:find("culled") then raise("Modules culling does not work\n%s", outdata) end end end function can_build() if is_subhost("windows") then return true elseif is_subhost("msys") then return true elseif is_host("linux") then local gcc = find_tool("gcc", {version = true}) if gcc and gcc.version and semver.compare(gcc.version, "11.0") >= 0 then return true end local clang = find_tool("clang", {version = true}) if clang and clang.version and semver.compare(clang.version, "14.0") >= 0 then return true end end end function main(t) if is_subhost("windows") then local clang = find_tool("clang", {version = true}) if clang and clang.version and semver.compare(clang.version, "17.0") >= 0 then os.exec("xmake f --toolchain=clang -c --yes") _build() os.exec("xmake clean -a") os.exec("xmake f --toolchain=clang --runtimes=c++_shared -c --yes") _build() end os.exec("xmake clean -a") os.exec("xmake f -c --yes") _build() elseif is_subhost("msys") then os.exec("xmake f -c -p mingw --yes") _build() elseif is_host("linux") then local gcc = find_tool("gcc", {version = true}) if gcc and gcc.version and semver.compare(gcc.version, "11.0") >= 0 then os.exec("xmake f -c --yes") _build() end local clang = find_tool("clang", {version = true}) if clang and clang.version and semver.compare(clang.version, "14.0") >= 0 then os.exec("xmake clean -a") os.exec("xmake f --toolchain=clang -c --yes") _build() os.exec("xmake clean -a") os.exec("xmake f --toolchain=clang --runtimes=c++_shared -c --yes") _build() end end end
0
repos/xmake/tests/projects/c++/modules
repos/xmake/tests/projects/c++/modules/culling2/xmake.lua
add_rules("mode.release", "mode.debug") set_languages("c++20") target("culling") set_kind("static") add_files("src/*.mpp", {cull = false})
0
repos/xmake/tests/projects/c++/modules
repos/xmake/tests/projects/c++/modules/inline_and_template/test.lua
inherit(".test_base")
0
repos/xmake/tests/projects/c++/modules
repos/xmake/tests/projects/c++/modules/inline_and_template/xmake.lua
add_rules("mode.release", "mode.debug") set_languages("c++20") target("inline_and_template") set_kind("binary") add_files("src/*.cpp", "src/*.mpp")
0
repos/xmake/tests/projects/c++/modules/inline_and_template
repos/xmake/tests/projects/c++/modules/inline_and_template/src/main.cpp
#include <iostream> import hello; import say; import foo; int main() { hello::say_hello(); say{}.hello<sizeof(say)>(); std::cout << foo<int>{}.hello() << std::endl; return 0; }
0
repos/xmake/tests/projects/c++/modules/inline_and_template
repos/xmake/tests/projects/c++/modules/inline_and_template/src/foo_impl.cpp
module foo; template <> struct foo<int> { constexpr const char* hello(void) const { return "hello int!"; } };
0
repos/xmake/tests/projects/c++/modules
repos/xmake/tests/projects/c++/modules/culling3/test.lua
import("lib.detect.find_tool") import("core.base.semver") import("utils.ci.is_running", {alias = "ci_is_running"}) function _build() local outdata if ci_is_running() then outdata = os.iorun("xmake -rvD") else outdata = os.iorun("xmake -rv") end if outdata then if not outdata:find("culled") then raise("Modules culling does not work\n%s", outdata) end end end function can_build() if is_subhost("windows") then return true elseif is_subhost("msys") then return true elseif is_host("linux") then local gcc = find_tool("gcc", {version = true}) if gcc and gcc.version and semver.compare(gcc.version, "11.0") >= 0 then return true end local clang = find_tool("clang", {version = true}) if clang and clang.version and semver.compare(clang.version, "14.0") >= 0 then return true end end end function main(t) if is_subhost("windows") then local clang = find_tool("clang", {version = true}) if clang and clang.version and semver.compare(clang.version, "17.0") >= 0 then os.exec("xmake f --toolchain=clang -c --yes") _build() os.exec("xmake clean -a") os.exec("xmake f --toolchain=clang --runtimes=c++_shared -c --yes") _build() end os.exec("xmake clean -a") os.exec("xmake f -c --yes") _build() elseif is_subhost("msys") then os.exec("xmake f -c -p mingw --yes") _build() elseif is_host("linux") then local gcc = find_tool("gcc", {version = true}) if gcc and gcc.version and semver.compare(gcc.version, "11.0") >= 0 then os.exec("xmake f -c --yes") _build() end local clang = find_tool("clang", {version = true}) if clang and clang.version and semver.compare(clang.version, "14.0") >= 0 then os.exec("xmake clean -a") os.exec("xmake f --toolchain=clang -c --yes") _build() os.exec("xmake clean -a") os.exec("xmake f --toolchain=clang --runtimes=c++_shared -c --yes") _build() end end end
0
repos/xmake/tests/projects/c++/modules
repos/xmake/tests/projects/c++/modules/culling3/xmake.lua
add_rules("mode.release", "mode.debug") set_languages("c++20") target("culling") set_kind("static") add_files("src/*.mpp")
0
repos/xmake/tests/projects/c++/modules
repos/xmake/tests/projects/c++/modules/user_headerunit2/test.lua
inherit(".test_headerunits")
0
repos/xmake/tests/projects/c++/modules
repos/xmake/tests/projects/c++/modules/user_headerunit2/xmake.lua
includes("a", "b") target("test") add_deps("a", "b") set_kind("phony")
0
repos/xmake/tests/projects/c++/modules/user_headerunit2
repos/xmake/tests/projects/c++/modules/user_headerunit2/a/c.hpp
#pragma once
0
repos/xmake/tests/projects/c++/modules/user_headerunit2
repos/xmake/tests/projects/c++/modules/user_headerunit2/a/d.hpp
#pragma once
0
repos/xmake/tests/projects/c++/modules/user_headerunit2
repos/xmake/tests/projects/c++/modules/user_headerunit2/a/xmake.lua
target("a") set_kind("moduleonly") add_headerfiles("*.hpp") add_files("a.mpp") set_languages("cxxlatest")
0
repos/xmake/tests/projects/c++/modules/user_headerunit2
repos/xmake/tests/projects/c++/modules/user_headerunit2/b/xmake.lua
target("b") add_deps("a") set_kind("moduleonly") add_files("b.mpp") set_languages("cxxlatest")
0
repos/xmake/tests/projects/c++/modules
repos/xmake/tests/projects/c++/modules/stdmodules_cpp_only/test.lua
inherit(".test_stdmodules")
0
repos/xmake/tests/projects/c++/modules
repos/xmake/tests/projects/c++/modules/stdmodules_cpp_only/xmake.lua
add_rules("mode.debug", "mode.release") set_languages("c++latest") target("stdmodules_cpp_only") set_kind("binary") add_files("src/*.cpp") set_policy("build.c++.modules", true)
0
repos/xmake/tests/projects/c++/modules/stdmodules_cpp_only
repos/xmake/tests/projects/c++/modules/stdmodules_cpp_only/src/main.cpp
import std; using namespace std; int main(int argc, char** argv) { cout << "hello world!" << endl; return 0; }
0
repos/xmake/tests/projects/c++/modules
repos/xmake/tests/projects/c++/modules/circular_dependency/test.lua
import(".test_base", {alias = "test_build"}) function main(t) if test_build.can_build() then t:will_raise(test_build, "circular modules dependency detected") end end
0
repos/xmake/tests/projects/c++/modules
repos/xmake/tests/projects/c++/modules/circular_dependency/xmake.lua
add_rules("mode.release", "mode.debug") set_languages("c++20") target("circular_dependency") set_kind("binary") add_files("src/*.cpp", "src/*.mpp")
0
repos/xmake/tests/projects/c++/modules/circular_dependency
repos/xmake/tests/projects/c++/modules/circular_dependency/src/main.cpp
import hello; int main() { hello::say s(sizeof(hello::say)); s.hello(); return 0; }
0
repos/xmake/tests/projects/c++/modules
repos/xmake/tests/projects/c++/modules/partitions_implunit/test.lua
inherit(".test_stdmodules")
0
repos/xmake/tests/projects/c++/modules
repos/xmake/tests/projects/c++/modules/partitions_implunit/xmake.lua
add_rules("mode.release", "mode.debug") set_languages("c++20") target("test") set_kind("binary") add_files("src/*.cpp", "src/*.mpp")
0
repos/xmake/tests/projects/c++/modules/partitions_implunit
repos/xmake/tests/projects/c++/modules/partitions_implunit/src/foo.cpp
// Foo.cpp module Foo; import :Impl; void foo() { bar(); }
0
repos/xmake/tests/projects/c++/modules/partitions_implunit
repos/xmake/tests/projects/c++/modules/partitions_implunit/src/main.cpp
import Foo; int main(int argc, char** argv) { foo(); return 0; }
0
repos/xmake/tests/projects/c++/modules
repos/xmake/tests/projects/c++/modules/dependence/test.lua
inherit(".test_base")
0
repos/xmake/tests/projects/c++/modules
repos/xmake/tests/projects/c++/modules/dependence/xmake.lua
add_rules("mode.release", "mode.debug") set_languages("c++20") target("dependence") set_kind("binary") add_files("src/*.cpp", "src/*.mpp")
0
repos/xmake/tests/projects/c++/modules/dependence
repos/xmake/tests/projects/c++/modules/dependence/src/hello_impl.cpp
module; #include <iostream> module hello; import mod; void inner() { std::cout << "hello world! data: " << mod::foo() << std::endl; } namespace hello { int data__; void say_hello() { ::inner(); } say::say(int data) : data_{data} { } void say::hello() { hello::data__ = data_; ::inner(); } }
0
repos/xmake/tests/projects/c++/modules/dependence
repos/xmake/tests/projects/c++/modules/dependence/src/main.cpp
import hello; int main() { hello::data__ = 123; hello::say_hello(); hello::say(sizeof(hello::say)).hello(); return 0; }
0
repos/xmake/tests/projects/c++/modules/dependence
repos/xmake/tests/projects/c++/modules/dependence/src/mod_impl.cpp
module mod; import hello; namespace mod { int foo() { return hello::data__; } }
0
repos/xmake/tests/projects/c++
repos/xmake/tests/projects/c++/shared_library_with_soname/test.lua
function main(t) t:build() end
0
repos/xmake/tests/projects/c++
repos/xmake/tests/projects/c++/shared_library_with_soname/xmake.lua
add_rules("mode.debug", "mode.release") set_version("1.0.1", {soname = true}) target("foo") set_kind("shared") add_files("src/foo.cpp") after_build(function (target) print(target:soname()) end) target("tests") set_kind("binary") add_deps("foo") add_files("src/main.cpp")
0
repos/xmake/tests/projects/c++/shared_library_with_soname
repos/xmake/tests/projects/c++/shared_library_with_soname/src/foo.h
#ifdef __cplusplus extern "C" { #endif #if defined(_WIN32) # define __export __declspec(dllexport) #elif defined(__GNUC__) && ((__GNUC__ >= 4) || (__GNUC__ == 3 && __GNUC_MINOR__ >= 3)) # define __export __attribute__((visibility("default"))) #else # define __export #endif __export int add(int a, int b); #ifdef __cplusplus } #endif
0
repos/xmake/tests/projects/c++/shared_library_with_soname
repos/xmake/tests/projects/c++/shared_library_with_soname/src/foo.cpp
#include "foo.h" int add(int a, int b) { return a + b; }
0
repos/xmake/tests/projects/c++/shared_library_with_soname
repos/xmake/tests/projects/c++/shared_library_with_soname/src/main.cpp
#include "foo.h" #include <iostream> using namespace std; int main(int argc, char** argv) { cout << "add(1, 2) = " << add(1, 2) << endl; return 0; }
0
repos/xmake/tests/projects/c++
repos/xmake/tests/projects/c++/precompiled_header/test3.cpp
#include "src/header.h" #include "src/header2.h" int test3() { return 0; }
0
repos/xmake/tests/projects/c++
repos/xmake/tests/projects/c++/precompiled_header/test.lua
function main(t) t:build() end
0
repos/xmake/tests/projects/c++
repos/xmake/tests/projects/c++/precompiled_header/xmake.lua
add_rules("mode.debug", "mode.release") target("main") set_kind("binary") set_languages("cxx11") set_pcxxheader("src/header.h") add_files("src/*.cpp", "src/*.c", "*.cpp")
0
repos/xmake/tests/projects/c++/precompiled_header
repos/xmake/tests/projects/c++/precompiled_header/src/test8.cpp
// main.cpp #include "header.h" int test8() { return 0; }
0
repos/xmake/tests/projects/c++/precompiled_header
repos/xmake/tests/projects/c++/precompiled_header/src/test.cpp
// main.cpp #include "header.h" int test() { return 0; }
0
repos/xmake/tests/projects/c++/precompiled_header
repos/xmake/tests/projects/c++/precompiled_header/src/test5.cpp
// main.cpp #include "header.h" int test5() { return 0; }
0
repos/xmake/tests/projects/c++/precompiled_header
repos/xmake/tests/projects/c++/precompiled_header/src/test6.cpp
// main.cpp #include "header.h" int test6() { return 0; }
0
repos/xmake/tests/projects/c++/precompiled_header
repos/xmake/tests/projects/c++/precompiled_header/src/test2.cpp
// main.cpp #include "header.h" int test2() { return 0; }
0
repos/xmake/tests/projects/c++/precompiled_header
repos/xmake/tests/projects/c++/precompiled_header/src/test7.cpp
// main.cpp #include "header.h" int test7() { return 0; }
0
repos/xmake/tests/projects/c++/precompiled_header
repos/xmake/tests/projects/c++/precompiled_header/src/test.c
void test_c(void) { }
0
repos/xmake/tests/projects/c++/precompiled_header
repos/xmake/tests/projects/c++/precompiled_header/src/main.cpp
#include "header.h" int main(int argc, char** argv) { std::string s("xmake"); printf("hello %s!\n", s.c_str()); return 0; }
0
repos/xmake/tests/projects/c++/precompiled_header
repos/xmake/tests/projects/c++/precompiled_header/src/header.h
// header.h #ifndef HEADER_H #define HEADER_H #include <algorithm> #include <deque> #include <iostream> #include <map> #include <memory> #include <set> //#include <thread> #include <utility> #include <vector> #include <string> #include <queue> #include <cstdlib> #include <utility> #include <exception> #include <list> #include <stack> #include <complex> #include <fstream> #include <cstdio> #include <iomanip> #endif
0
repos/xmake/tests/projects/c++/precompiled_header
repos/xmake/tests/projects/c++/precompiled_header/src/test4.cpp
// main.cpp #include "header.h" int test4() { return 0; }
0
repos/xmake/tests/projects/c++
repos/xmake/tests/projects/c++/shared_library_export_all/test.lua
function main(t) t:build() end
0
repos/xmake/tests/projects/c++
repos/xmake/tests/projects/c++/shared_library_export_all/xmake.lua
add_rules("mode.debug", "mode.release") target("foo") set_kind("shared") add_files("src/foo.cpp") add_rules("utils.symbols.export_all", {export_classes = true}) target("bar") set_kind("shared") add_files("src/bar.cpp") add_rules("utils.symbols.export_all", {export_filter = function (symbol) if symbol:find("add", 1, true) then return true end end}) target("demo") set_kind("binary") add_deps("foo", "bar") add_files("src/main.cpp")
0
repos/xmake/tests/projects/c++/shared_library_export_all
repos/xmake/tests/projects/c++/shared_library_export_all/src/foo.h
class foo { public: static int add(int a, int b); };
0
repos/xmake/tests/projects/c++/shared_library_export_all
repos/xmake/tests/projects/c++/shared_library_export_all/src/bar.cpp
#include "bar.h" int bar::add(int a, int b) { return a + b; }
0
repos/xmake/tests/projects/c++/shared_library_export_all
repos/xmake/tests/projects/c++/shared_library_export_all/src/foo.cpp
#include "foo.h" int foo::add(int a, int b) { return a + b; }
0
repos/xmake/tests/projects/c++/shared_library_export_all
repos/xmake/tests/projects/c++/shared_library_export_all/src/main.cpp
#include "foo.h" #include "bar.h" #include <iostream> int main(int argc, char** argv) { std::cout << "foo::add(1, 2) = " << foo::add(1, 2) << std::endl; std::cout << "bar::add(1, 2) = " << bar::add(1, 2) << std::endl; return 0; }
0
repos/xmake/tests/projects/c++/shared_library_export_all
repos/xmake/tests/projects/c++/shared_library_export_all/src/bar.h
class bar { public: static int add(int a, int b); };
0
repos/xmake/tests/projects/c++
repos/xmake/tests/projects/c++/protobuf_grpc_cpp_plugin/xmake.lua
add_rules("mode.debug", "mode.release") add_requires("protobuf-cpp") add_requires("grpc", {system = false}) target("test") set_kind("binary") set_languages("c++17") add_packages("protobuf-cpp") add_packages("grpc") add_rules("protobuf.cpp") add_files("src/*.cpp") add_files("src/test.proto", {proto_rootdir = "src", proto_grpc_cpp_plugin = true}) add_files("src/subdir/test2.proto", {proto_rootdir = "src"})
0
repos/xmake/tests/projects/c++/protobuf_grpc_cpp_plugin
repos/xmake/tests/projects/c++/protobuf_grpc_cpp_plugin/src/test.proto
syntax = "proto3"; import "subdir/test2.proto"; package test; message TestCase { string name = 4; } message Test { repeated TestCase case = 1; repeated test2.TestCase2 case2 = 2; } message EchoRequest { string data = 1; } message EchoResponse { string data = 1; } service EchoServer { rpc Echo(EchoRequest) returns (EchoResponse); }
0
repos/xmake/tests/projects/c++/protobuf_grpc_cpp_plugin
repos/xmake/tests/projects/c++/protobuf_grpc_cpp_plugin/src/main.cpp
#include <iostream> #include "test.pb.h" #include "subdir/test2.pb.h" using namespace std; int main(int argc, char** argv) { cout << "hello world!" << endl; return 0; }
0
repos/xmake/tests/projects/c++/protobuf_grpc_cpp_plugin/src
repos/xmake/tests/projects/c++/protobuf_grpc_cpp_plugin/src/subdir/test2.proto
syntax = "proto3"; package test2; message TestCase2 { string name2 = 4; } message Test2 { repeated TestCase2 case2 = 1; }
0
repos/xmake/tests/projects/c++
repos/xmake/tests/projects/c++/console/test.lua
function main(t) t:build() end
0
repos/xmake/tests/projects/c++
repos/xmake/tests/projects/c++/console/xmake.lua
add_rules("mode.debug", "mode.release") target("test") set_kind("binary") add_files("src/*.cpp")
0
repos/xmake/tests/projects/c++/console
repos/xmake/tests/projects/c++/console/src/main.cpp
#include <iostream> int main(int argc, char** argv) { std::cout << "hello world!" << std::endl; return 0; }
0
repos/xmake/tests/projects/c++
repos/xmake/tests/projects/c++/unity_build/test.lua
function main(t) t:build() end
0
repos/xmake/tests/projects/c++
repos/xmake/tests/projects/c++/unity_build/xmake.lua
target("test") set_kind("binary") add_includedirs("src") add_rules("c++.unity_build", {batchsize = 2, uniqueid = "MY_UNITY_ID"}) add_files("src/*.c", "src/*.cpp") add_files("src/foo/*.cpp", {unity_group = "foo"}) add_files("src/bar/*.cpp", {unity_group = "bar"})
0
repos/xmake/tests/projects/c++/unity_build
repos/xmake/tests/projects/c++/unity_build/src/test8.cpp
// main.cpp #include "header.h" int test8() { return 0; }
0
repos/xmake/tests/projects/c++/unity_build
repos/xmake/tests/projects/c++/unity_build/src/test7.cpp
// main.cpp #include "header.h" int test7() { return 0; }
0
repos/xmake/tests/projects/c++/unity_build
repos/xmake/tests/projects/c++/unity_build/src/test.c
void test_c(void) { }
0
repos/xmake/tests/projects/c++/unity_build
repos/xmake/tests/projects/c++/unity_build/src/main.cpp
#include "header.h" int main(int argc, char** argv) { std::string s("xmake"); printf("hello %s!\n", s.c_str()); return 0; }
0
repos/xmake/tests/projects/c++/unity_build
repos/xmake/tests/projects/c++/unity_build/src/header.h
// header.h #ifndef HEADER_H #define HEADER_H #include <algorithm> #include <deque> #include <iostream> #include <map> #include <memory> #include <set> //#include <thread> #include <utility> #include <vector> #include <string> #include <queue> #include <cstdlib> #include <utility> #include <exception> #include <list> #include <stack> #include <complex> #include <fstream> #include <cstdio> #include <iomanip> #endif
0
repos/xmake/tests/projects/c++/unity_build/src
repos/xmake/tests/projects/c++/unity_build/src/bar/test5.cpp
// main.cpp #include "header.h" namespace MY_UNITY_ID { int i = 42; } int test5() { return MY_UNITY_ID::i; }
0
repos/xmake/tests/projects/c++/unity_build/src
repos/xmake/tests/projects/c++/unity_build/src/bar/test6.cpp
// main.cpp #include "header.h" int test6() { return 0; }
0
repos/xmake/tests/projects/c++/unity_build/src
repos/xmake/tests/projects/c++/unity_build/src/bar/test4.cpp
// main.cpp #include "header.h" namespace MY_UNITY_ID { int i = 42; } int test4() { return MY_UNITY_ID::i; }
0
repos/xmake/tests/projects/c++/unity_build/src
repos/xmake/tests/projects/c++/unity_build/src/foo/test.cpp
// main.cpp #include "header.h" int test() { return 0; }
0
repos/xmake/tests/projects/c++/unity_build/src
repos/xmake/tests/projects/c++/unity_build/src/foo/test2.cpp
// main.cpp #include "header.h" int test2() { return 0; }
0
repos/xmake/tests/projects/c++
repos/xmake/tests/projects/c++/static_library/test.lua
function main(t) t:build() end
0
repos/xmake/tests/projects/c++
repos/xmake/tests/projects/c++/static_library/xmake.lua
add_rules("mode.debug", "mode.release") target("foo") set_kind("static") add_files("src/foo.cpp") target("demo") set_kind("binary") add_deps("foo") add_files("src/main.cpp")
0
repos/xmake/tests/projects/c++/static_library
repos/xmake/tests/projects/c++/static_library/src/foo.h
#ifdef __cplusplus extern "C" { #endif int add(int a, int b); #ifdef __cplusplus } #endif
0
repos/xmake/tests/projects/c++/static_library
repos/xmake/tests/projects/c++/static_library/src/foo.cpp
#include "foo.h" int add(int a, int b) { return a + b; }
0
repos/xmake/tests/projects/c++/static_library
repos/xmake/tests/projects/c++/static_library/src/main.cpp
#include "foo.h" #include <iostream> using namespace std; int main(int argc, char** argv) { cout << "add(1, 2) = " << add(1, 2) << endl; return 0; }
0
repos/xmake/tests/projects/c++
repos/xmake/tests/projects/c++/test(brackets)/test.lua
function main(t) t:build() end
0
repos/xmake/tests/projects/c++
repos/xmake/tests/projects/c++/test(brackets)/xmake.lua
add_rules("mode.debug", "mode.release") target("demo") set_kind("binary") add_files("src/*.cpp") add_includedirs("inc(brackets)") add_defines("WORD=\"(world)\"")
0
repos/xmake/tests/projects/c++/test(brackets)
repos/xmake/tests/projects/c++/test(brackets)/inc(brackets)/test.h
#define TEST "hello"