Skip to content

Commit

Permalink
[basis-universal] test, enable SSE options
Browse files Browse the repository at this point in the history
  • Loading branch information
luncliff committed Feb 26, 2025
1 parent ee254de commit 4a95174
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 4 deletions.
23 changes: 19 additions & 4 deletions ports/basis-universal/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -29,15 +29,30 @@ if(MSVC)
check_cxx_compiler_flag("/arch:SSE" USE_SSE)

else()
set(CMAKE_CXX_VISIBILITY_PRESET "hidden")
set(CMAKE_CXX_VISIBILITY_PRESET "default") # use hidden?
set(CMAKE_POSITION_INDEPENDENT_CODE ON)

add_compile_definitions(
-fno-strict-aliasing
# -fno-strict-aliasing
_LARGEFILE64_SOURCE=1
-D_FILE_OFFSET_BITS=64
)
check_cxx_compiler_flag("-msse4.1" USE_SSE)
if(CMAKE_SYSTEM_PROCESSOR MATCHES x86)
check_cxx_compiler_flag("-msse4" USE_SSE4)
if(USE_SSE4)
add_compile_options("-msse4")
endif()
check_cxx_compiler_flag("-msse4.1" USE_SSE41)
if(USE_SSE41)
add_compile_options("-msse4.1")
endif()
check_cxx_compiler_flag("-msse4.2" USE_SSE42)
if(USE_SSE42)
add_compile_options("-msse4.2")
endif()
if(USE_SSE4 OR USE_SSE41 OR USE_SSE42)
set(USE_SSE ON)
endif()
endif()
endif()

if(USE_SSE)
Expand Down
2 changes: 2 additions & 0 deletions ports/basis-universal/portfile.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,8 @@ vcpkg_from_github(
PATCHES
fix-zstd-import.patch
)
# check https://gcc.gnu.org/onlinedocs/
# check https://www.gnu.org/software/libc/manual/html_node/Feature-Test-Macros.html
# todo: support basisu_tool.cpp build
# todo: support EMSCRIPTEN for ${SOURCE_PATH}/webgl sources
file(COPY "${CMAKE_CURRENT_LIST_DIR}/CMakeLists.txt" DESTINATION "${SOURCE_PATH}")
Expand Down

0 comments on commit 4a95174

Please sign in to comment.