Skip to content

Commit

Permalink
[sift] Fix building on platforms without SSE2
Browse files Browse the repository at this point in the history
  • Loading branch information
p12tic committed Sep 14, 2022
1 parent deb047f commit b7184ee
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion src/nonFree/sift/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -44,11 +44,16 @@ set(FEATS_H
set_source_files_properties(${FEATS} ${FEATS_H} PROPERTIES LANGUAGE C)
set_source_files_properties(${FEATS_H} PROPERTIES HEADER_FILE_ONLY TRUE)

set(SIMD_DEFINITIONS "-DVL_DISABLE_AVX")
if(NOT ALICEVISION_HAVE_SSE)
set(SIMD_DEFINITIONS "${SIMD_DEFINITIONS} -DVL_DISABLE_SSE2")
endif()

alicevision_add_library(vlsift
SOURCES
${FEATS} ${FEATS_H}
PUBLIC_DEFINITIONS
-DVL_DISABLE_AVX
${SIMD_DEFINITIONS}
PRIVATE_DEFINITIONS
-DVL_BUILD_DLL
)
Expand Down

3 comments on commit b7184ee

@demoulinv
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hi, this change prevents sift to be built on Windows using VisualStudio.
erreur visual studio
It seems the cmake is not correct anymore.

@p12tic
Copy link
Contributor Author

@p12tic p12tic commented on b7184ee Sep 20, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@demoulinv Interesting, seems like Visual Studio generator handles target_compile_definitions differently than the others.

Could you tell me, does it work if we change option setup to this:

set(SIMD_DEFINITIONS "-DVL_DISABLE_AVX")
if(NOT ALICEVISION_HAVE_SSE)
    list(APPEND SIMD_DEFINITIONS "-DVL_DISABLE_SSE2")
endif()

@demoulinv
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@p12tic Yes, your update fixes the problem on windows with Visual Studio.

Please sign in to comment.