Skip to content

Commit

Permalink
math/libdivide: Add NATIVE option
Browse files Browse the repository at this point in the history
PR:		272497
Approved by:	thierry@ (maintainer)
  • Loading branch information
yurivict committed Jul 21, 2023
1 parent 3a20804 commit 8bafc25
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 1 deletion.
5 changes: 5 additions & 0 deletions math/libdivide/Makefile
@@ -1,5 +1,6 @@
PORTNAME= libdivide
DISTVERSION= 5.0
PORTREVISION= 1
CATEGORIES= math

MAINTAINER= thierry@FreeBSD.org
Expand All @@ -24,6 +25,10 @@ PLIST_FILES= include/libdivide.h \
lib/cmake/libdivide/libdivideConfig.cmake \
lib/cmake/libdivide/libdivideConfigVersion.cmake

OPTIONS_DEFINE= NATIVE

NATIVE_CMAKE_BOOL= FREEBSD_NATIVE

do-test:
${CONFIGURE_WRKSRC}/tester

Expand Down
7 changes: 6 additions & 1 deletion math/libdivide/files/patch-CMakeLists.txt
Expand Up @@ -13,11 +13,16 @@
)

# Build options ################################################
@@ -93,7 +93,6 @@ if (BUILD_TESTS AND NOT CMAKE_CROSSCOMPILING)
@@ -93,11 +93,10 @@ if (BUILD_TESTS AND NOT CMAKE_CROSSCOMPILING)
CPU_ARM_NEON)
if (CPU_X86 OR CPU_ARM_NEON)
cmake_push_check_state()
- set(CMAKE_REQUIRED_FLAGS -Werror)
check_cxx_compiler_flag(-march=native MARCH_NATIVE)
cmake_pop_check_state()

- if (MARCH_NATIVE)
+ if (MARCH_NATIVE AND FREEBSD_NATIVE)
list(APPEND LIBDIVIDE_FLAGS "-march=native")
endif()
endif()

0 comments on commit 8bafc25

Please sign in to comment.