Skip to content

Commit

Permalink
Adjust
Browse files Browse the repository at this point in the history
  • Loading branch information
vgvassilev committed Mar 20, 2024
1 parent 45bf3cd commit ccb1f26
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 18 deletions.
11 changes: 7 additions & 4 deletions recipe/meta.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,8 @@ source:
build:
number: {{ build_number }}
string: clang{{ (clangdev or "None").split(".")[0] }}_repl_h{{ PKG_HASH }}_{{ build_number }}
ignore_run_exports:
- zstd # [win]

requirements:
build:
Expand All @@ -46,7 +48,7 @@ requirements:
- backtrace # [unix and x86]
- libxml2
- zlib
- zstd # [not win]
- zstd # [unix]
- libcxx {{ cxx_compiler_version }} # [osx]
- libstdcxx-ng {{ cxx_compiler_version }} # [linux]
run_constrained:
Expand All @@ -73,17 +75,18 @@ test:
# Avoid Bad CPU from cmake when cross-compiling on osx and arm...
- exit 0 # [build_platform != target_platform]
- mkdir -p cmake_build_test && pushd cmake_build_test
- {{ cxx_compiler }} -xc++ -E -v /dev/null # [unix]
- cmake -DCMAKE_BUILD_TYPE=Debug -DCONDA_PREFIX="$BUILD_PREFIX" -G "Ninja" ..
- cmake --build . --config Debug -- -v
- ./cmake_build_test || true #FIXME
- ./cmake_build_test {{ cxx_compiler }} # [unix]
- rm -fr *
- cmake -DCMAKE_BUILD_TYPE=Release -DCONDA_PREFIX="$BUILD_PREFIX" -G "Ninja" ..
- cmake --build . --config Release
- ./cmake_build_test || true #FIXME
- ./cmake_build_test {{ cxx_compiler }} # [unix]
- rm -fr *
- cmake -DCMAKE_BUILD_TYPE=RelWithDebInfo -DCONDA_PREFIX="$BUILD_PREFIX" -G "Ninja" ..
- cmake --build . --config RelWithDebInfo
- ./cmake_build_test || true #FIXME
- ./cmake_build_test {{ cxx_compiler }} # [unix]
- popd

about:
Expand Down
2 changes: 1 addition & 1 deletion recipe/patches/cppinterop/0006-Add-DllExports.patch
Original file line number Diff line number Diff line change
Expand Up @@ -213,7 +213,7 @@ index 96345ffb..004cf5bf 100644
/// can be used to iterate through the index value to get each specific
/// base class.
- TCppScope_t GetBaseClass(TCppType_t klass, TCppIndex_t ibase);
+ DllExport DllExport TCppScope_t GetBaseClass(TCppType_t klass, TCppIndex_t ibase);
+ DllExport TCppScope_t GetBaseClass(TCppType_t klass, TCppIndex_t ibase);

/// Checks if the supplied Derived Class is a sub-class of the
/// provided Base Class.
Expand Down
21 changes: 8 additions & 13 deletions recipe/test.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ inline std::string append_path(const std::string &to, const std::string& what) {

using Args = std::vector<std::string>;

void* createInterpreter(const Args &ExtraArgs = {}) {
void* createInterpreter(const char* CxxCompiler, const Args &ExtraArgs = {}) {
Args ClangArgs;
if (std::find(ExtraArgs.begin(), ExtraArgs.end(), "-resource-dir") != ExtraArgs.end()) {
std::string resource_dir = Cpp::DetectResourceDir();
Expand All @@ -31,12 +31,11 @@ void* createInterpreter(const Args &ExtraArgs = {}) {
ClangArgs.push_back(resource_dir);
}
std::vector<std::string> CxxSystemIncludes;
const char* DefaultCxxName = "x86_64-conda-linux-gnu-c++";
// Oddly, conda supports "pseudo cross-compilation" and gives us the compiler
// include paths relative to the compiler binary. Now we need to find out
// where that binary is...
const char* Prefix = CONDA_PREFIX;
Cpp::DetectSystemCompilerIncludePaths(CxxSystemIncludes, DefaultCxxName);
Cpp::DetectSystemCompilerIncludePaths(CxxSystemIncludes, CxxCompiler);
for (std::string CxxInclude : CxxSystemIncludes) {
if (!file_exists(CxxInclude)) {
// Try make these paths absolute.
Expand All @@ -59,18 +58,14 @@ void* createInterpreter(const Args &ExtraArgs = {}) {
std::transform(ClangArgs.begin(), ClangArgs.end(), Args.begin(),
[](const std::string &s) -> const char * { return s.data(); });

for (const char* arg : Args)
std::cout << arg << "\n";

std::cout << "----------------\n";

for (auto arg : ClangArgs)
std::cout << arg << "\n";

return Cpp::CreateInterpreter(Args/*, {"-cuda"}*/);
}

int main() {
createInterpreter({"-v"});
int main(int argc, char *argv[]) {
if (argc < 2)
std::cerr << "Not enough arguments. Pass a compiler name.\n";

createInterpreter(argv[1], {"-v"});

return Cpp::Process("#include <string>");
}

0 comments on commit ccb1f26

Please sign in to comment.