mirror of
https://github.com/zama-ai/concrete.git
synced 2026-02-10 04:35:03 -05:00
fix: use appropriate cmd for dynamic lib generation
macos and linux require a different cmd
This commit is contained in:
@@ -408,11 +408,16 @@ const std::string CompilerEngine::Library::OBJECT_EXT = ".o";
|
||||
const std::string CompilerEngine::Library::CLIENT_PARAMETERS_EXT =
|
||||
".concrete.params.json";
|
||||
const std::string CompilerEngine::Library::LINKER = "ld";
|
||||
#ifdef __APPLE__
|
||||
const std::string CompilerEngine::Library::LINKER_SHARED_OPT = " -dylib -o ";
|
||||
const std::string CompilerEngine::Library::DOT_SHARED_LIB_EXT = ".dylib";
|
||||
#else // Linux
|
||||
const std::string CompilerEngine::Library::LINKER_SHARED_OPT = " --shared -o ";
|
||||
const std::string CompilerEngine::Library::DOT_SHARED_LIB_EXT = ".so";
|
||||
#endif
|
||||
const std::string CompilerEngine::Library::AR = "ar";
|
||||
const std::string CompilerEngine::Library::AR_STATIC_OPT = " rcs ";
|
||||
const std::string CompilerEngine::Library::DOT_STATIC_LIB_EXT = ".a";
|
||||
const std::string CompilerEngine::Library::DOT_SHARED_LIB_EXT = ".so";
|
||||
|
||||
void CompilerEngine::Library::addExtraObjectFilePath(std::string path) {
|
||||
objectsPath.push_back(path);
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
import os
|
||||
import subprocess
|
||||
import sys
|
||||
|
||||
import pytest
|
||||
|
||||
@@ -17,7 +18,8 @@ SOURCE_C_2 = f'{TEST_PATH}/main_return_0.c'
|
||||
OUTPUT = f'{TEST_PATH}/output.mlir'
|
||||
LIB = f'{TEST_PATH}/outlib'
|
||||
LIB_STATIC = LIB + '.a'
|
||||
LIB_DYNAMIC = LIB + '.so'
|
||||
DYNAMIC_LIB_EXT = '.dylib' if sys.platform == 'darwin' else '.so'
|
||||
LIB_DYNAMIC = LIB + DYNAMIC_LIB_EXT
|
||||
LIBS = (LIB_STATIC, LIB_DYNAMIC)
|
||||
|
||||
assert_exists(SOURCE_1, SOURCE_2, SOURCE_C_1, SOURCE_C_2)
|
||||
|
||||
Reference in New Issue
Block a user