Skip to content

Commit

Permalink
Fix build
Browse files Browse the repository at this point in the history
Signed-off-by: Vitalii Koshura <[email protected]>
  • Loading branch information
AenBleidd committed Jun 1, 2024
1 parent 249213d commit 19b69ff
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 6 deletions.
4 changes: 1 addition & 3 deletions boinc-autodock-vina/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ project (boinc-autodock-vina CXX)
find_package(autodock-vina REQUIRED)
find_package(boinc REQUIRED)
find_package(OpenSSL REQUIRED)
find_package(Boost REQUIRED COMPONENTS filesystem log math_tr1 program_options random serialization thread timer)
find_package(Boost REQUIRED COMPONENTS filesystem log program_options random serialization thread timer)
find_package(magic_enum CONFIG REQUIRED)
find_package(jsoncons CONFIG REQUIRED)
find_package(GTest CONFIG REQUIRED)
Expand Down Expand Up @@ -181,7 +181,6 @@ if (NOT COVERAGE_REPORT)
Boost::boost
Boost::filesystem
Boost::log
Boost::math_tr1
Boost::program_options
Boost::random
Boost::serialization
Expand Down Expand Up @@ -213,7 +212,6 @@ set (UNIT_TEST_LINK_LIBRARIES
Boost::boost
Boost::filesystem
Boost::log
Boost::math_tr1
Boost::program_options
Boost::random
Boost::serialization
Expand Down
16 changes: 13 additions & 3 deletions build.py
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ def install_android_ndk(build_path, app, triplet):

return os.path.join(ndk_path, 'android-ndk-' + ndk_version)

def build_specific_init_params(CC, CXX, LD, CFLAGS, CXXFLAGS, LDFLAGS):
def build_specific_init_params(CC, CXX, LD, CFLAGS, CXXFLAGS, LDFLAGS, AFLAGS, ASFLAGS):
specific_init_params = ''

if (CC is not None):
Expand All @@ -96,6 +96,10 @@ def build_specific_init_params(CC, CXX, LD, CFLAGS, CXXFLAGS, LDFLAGS):
specific_init_params = ('{specific_init_params} CXXFLAGS="{CXXFLAGS}"').format(specific_init_params=specific_init_params, CXXFLAGS=CXXFLAGS)
if (LDFLAGS is not None):
specific_init_params = ('{specific_init_params} LDFLAGS="{LDFLAGS}"').format(specific_init_params=specific_init_params, LDFLAGS=LDFLAGS)
if (AFLAGS is not None):
specific_init_params = ('{specific_init_params} AFLAGS="{AFLAGS}"').format(specific_init_params=specific_init_params, AFLAGS=AFLAGS)
if (ASFLAGS is not None):
specific_init_params = ('{specific_init_params} ASFLAGS="{ASFLAGS}"').format(specific_init_params=specific_init_params, ASFLAGS=ASFLAGS)

if (specific_init_params != ''):
specific_init_params = ('cmake -E env {specific_init_params}').format(specific_init_params=specific_init_params)
Expand All @@ -109,6 +113,8 @@ def build_linux_specific_init_params(arch, code_analysis=False):
CFLAGS = None
CXXFLAGS = None
LDFLAGS = None
AFLAGS = None
ASFLAGS = None

if (arch == '64' or arch == '32'):
if (code_analysis == True):
Expand All @@ -121,6 +127,8 @@ def build_linux_specific_init_params(arch, code_analysis=False):
CFLAGS = ('-m{arch}').format(arch=arch)
CXXFLAGS = ('-m{arch}').format(arch=arch)
LDFLAGS =('-m{arch} -static-libstdc++ -static').format(arch=arch)
AFLAGS = ('-m{arch}').format(arch=arch)
ASFLAGS = ('-m{arch}').format(arch=arch)

elif (arch == 'arm'):
CC = 'arm-linux-gnueabihf-gcc'
Expand All @@ -144,7 +152,7 @@ def build_linux_specific_init_params(arch, code_analysis=False):
CXXFLAGS = '-march=armv8-a'
LDFLAGS = '-march=armv8-a -static-libstdc++ -static'

return build_specific_init_params(CC, CXX, LD, CFLAGS, CXXFLAGS, LDFLAGS)
return build_specific_init_params(CC, CXX, LD, CFLAGS, CXXFLAGS, LDFLAGS, AFLAGS, ASFLAGS)

def build_android_specific_init_params(arch, tc_path):
CC = None
Expand All @@ -153,6 +161,8 @@ def build_android_specific_init_params(arch, tc_path):
CFLAGS = None
CXXFLAGS = None
LDFLAGS = None
AFLAGS = None
ASFLAGS = None

if (arch == 'arm' or arch == 'armneon'):
toolchain_root = os.path.join(tc_path, 'toolchains', 'llvm', 'prebuilt', 'linux-x86_64')
Expand Down Expand Up @@ -247,7 +257,7 @@ def build_android_specific_init_params(arch, tc_path):
includes=includes
)

return build_specific_init_params(CC, CXX, LD, CFLAGS, CXXFLAGS, LDFLAGS)
return build_specific_init_params(CC, CXX, LD, CFLAGS, CXXFLAGS, LDFLAGS, AFLAGS, ASFLAGS)

def fix_path_for_android(arch, android_tc_path):
os.environ['ANDROID_NDK_HOME'] = android_tc_path
Expand Down

0 comments on commit 19b69ff

Please sign in to comment.