Skip to content

Commit

Permalink
libelf: fix build failure using mingw (#25276)
Browse files Browse the repository at this point in the history
* libelf: fix missing inclusion of config.h on windows, remove test_v1_package

* Assume settings_build is defined

---------

Co-authored-by: Luis Caro Campos <[email protected]>
  • Loading branch information
joda01 and jcar87 authored Dec 6, 2024
1 parent 13febde commit 37116e6
Show file tree
Hide file tree
Showing 4 changed files with 3 additions and 32 deletions.
4 changes: 2 additions & 2 deletions recipes/libelf/all/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ project(elf LANGUAGES C)

if(EXISTS "${LIBELF_SRC_DIR}/lib/sys_elf.h.w32")
file(RENAME "${LIBELF_SRC_DIR}/lib/sys_elf.h.w32" "${LIBELF_SRC_DIR}/lib/sys_elf.h")
file(RENAME "${LIBELF_SRC_DIR}/lib/config.h.w32" "${LIBELF_SRC_DIR}/config.h")
file(RENAME "${LIBELF_SRC_DIR}/lib/config.h.w32" "${LIBELF_SRC_DIR}/lib/config.h")
endif()

file(GLOB_RECURSE SOURCES "${LIBELF_SRC_DIR}/lib/*.c")
Expand All @@ -15,7 +15,7 @@ set_target_properties(${PROJECT_NAME} PROPERTIES
WINDOWS_EXPORT_ALL_SYMBOLS TRUE
)
target_include_directories(${PROJECT_NAME} SYSTEM PUBLIC "${LIBELF_SRC_DIR}/lib")
target_compile_definitions(${PROJECT_NAME} PUBLIC HAVE_MEMCMP=1 HAVE_MEMCPY=1 HAVE_MEMMOVE=1)
target_compile_definitions(${PROJECT_NAME} PUBLIC HAVE_MEMCMP=1 HAVE_MEMCPY=1 HAVE_MEMMOVE=1 HAVE_CONFIG_H=1)

include(GNUInstallDirs)

Expand Down
6 changes: 1 addition & 5 deletions recipes/libelf/all/conanfile.py
Original file line number Diff line number Diff line change
Expand Up @@ -31,10 +31,6 @@ class LibelfConan(ConanFile):

exports_sources = "CMakeLists.txt"

@property
def _settings_build(self):
return getattr(self, "settings_build", self.settings)

def config_options(self):
if self.settings.os == "Windows":
del self.options.fPIC
Expand All @@ -58,7 +54,7 @@ def build_requirements(self):
if self.settings.os != "Windows":
self.tool_requires("autoconf/2.71")
self.tool_requires("gnu-config/cci.20210814")
if self._settings_build.os == "Windows":
if self.settings_build.os == "Windows":
self.win_bash = True
if not self.conf.get("tools.microsoft.bash:path", check_type=str):
self.tool_requires("msys2/cci.latest")
Expand Down
8 changes: 0 additions & 8 deletions recipes/libelf/all/test_v1_package/CMakeLists.txt

This file was deleted.

17 changes: 0 additions & 17 deletions recipes/libelf/all/test_v1_package/conanfile.py

This file was deleted.

0 comments on commit 37116e6

Please sign in to comment.