Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Simplify build workflow #469

Merged
merged 11 commits into from
Jun 26, 2024
Prev Previous commit
Next Next commit
Set flags for MSVC
  • Loading branch information
s-zanella committed May 20, 2024
commit a665439cbdbb500d496e349966d6212774eb732a
27 changes: 19 additions & 8 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -88,8 +88,11 @@ set(CMAKE_C_STANDARD_REQUIRED True)
include(build/config.cmake)

# Configure different targets
# TODO: Set flags for MSVC
if(NOT MSVC)
if(MSVC)
add_compile_options(
/Ob3
)
else()
add_compile_options(
# -Wall
# -Wextra
Expand All @@ -102,12 +105,20 @@ if(NOT MSVC)
)
endif()

if(WIN32 AND NOT MSVC)
# Enable everywhere for windows as long as libintvector.h is not included correctly.
add_compile_options(
-mavx
-mavx2
)
if(WIN32)
# Enable AVX and AVX2 everywhere for Windows as long as libintvector.h is not included correctly.
if(MSVC)
add_compile_options(
/arch:AVX
/arch:AVX2
)
else()
# On Windows with clang-cl (our default) we take the Linux assembly
add_compile_options(
-mavx
-mavx2
)
endif()
endif()

# Set include paths
Expand Down