Skip to content

Conversation

@luadebug
Copy link
Contributor

@luadebug luadebug commented Sep 30, 2025

CMakeLists.txt: support AVX2 detection for xmake-io/xmake-repo#8277
vcpkg produced somewhat similiar:
enable-avx2-on-gcc.patch

diff --git a/CMakeLists.txt b/CMakeLists.txt
index 18c1b45..fe8d702 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -93,7 +93,7 @@ if (OMATH_STATIC_MSVC_RUNTIME_LIBRARY)
     )
 endif ()
 
-if (OMATH_USE_AVX2 AND CMAKE_CXX_COMPILER_ID STREQUAL "Clang")
+if (OMATH_USE_AVX2 AND (CMAKE_CXX_COMPILER_ID STREQUAL "Clang" OR CMAKE_CXX_COMPILER_ID STREQUAL "GNU"))
     target_compile_options(${PROJECT_NAME} PUBLIC -mavx2 -mavx -mfma)
 endif ()

@luadebug luadebug changed the title CMakeLists.txt: support AVX2 detection for https://github.com/xmake-io/xmake-repo/pull/8277 CMakeLists.txt: support AVX2 detection Sep 30, 2025
@orange-cpp orange-cpp merged commit 1efdb50 into orange-cpp:main Oct 1, 2025
3 checks passed
@orange-cpp
Copy link
Owner

granted, thx <3

@luadebug luadebug deleted the patch-1 branch October 1, 2025 01:17
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants