build: Fixed some issues to make porting to other systems easier

This commit is contained in:
WerWolv
2022-08-01 14:35:25 +02:00
parent be0fe4c0d0
commit 84e049be07
4 changed files with 9 additions and 3 deletions

View File

@@ -2,6 +2,7 @@ cmake_minimum_required(VERSION 3.16)
# Options
option(IMHEX_OFFLINE_BUILD "Enable offline build" OFF)
option(IMHEX_IGNORE_BAD_CLONE "Disabled the bad clone prevention checks" OFF)
option(IMHEX_PATTERNS_PULL_MASTER "Download latest files from master branch of the ImHex-Patterns repo" OFF)
# Basic compiler and cmake configurations

View File

@@ -294,7 +294,11 @@ function(loadVersion version)
set(${version} ${read_version} PARENT_SCOPE)
endfunction()
macro(detectBadClone)
function(detectBadClone)
if (IMHEX_IGNORE_BAD_CLONE)
return()
endif()
file (GLOB EXTERNAL_DIRS "lib/external/*")
foreach (EXTERNAL_DIR ${EXTERNAL_DIRS})
file(GLOB RESULT "${EXTERNAL_DIR}/*")
@@ -303,7 +307,7 @@ macro(detectBadClone)
message(FATAL_ERROR "External dependency ${EXTERNAL_DIR} is empty!\nMake sure to correctly clone ImHex using the --recurse-submodules git option or initialize the submodules manually.")
endif()
endforeach ()
endmacro()
endfunction()
macro(setVariableInParent variable value)
get_directory_property(hasParent PARENT_DIRECTORY)

View File

@@ -14,6 +14,7 @@
#else
#include <unistd.h>
#include <sys/socket.h>
#include <netinet/in.h>
#include <netinet/ip.h>
#include <arpa/inet.h>