Skip to content

Commit

Permalink
try making ascii-only symbolic links to resolve UTF issues on Windows
Browse files Browse the repository at this point in the history
  • Loading branch information
evaleev committed Nov 30, 2023
1 parent 2f720c6 commit 9e5ba31
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 4 deletions.
2 changes: 0 additions & 2 deletions .github/workflows/cmake.yml
Original file line number Diff line number Diff line change
Expand Up @@ -284,8 +284,6 @@ jobs:
-DLIBINT2_PYTHON=ON \
-DCMAKE_PREFIX_PATH="${CONDA_PREFIX}" \
${{ matrix.cfg.libargs }}
cat build/build.ninja
ninja -t wincodepage
cmake --build build --target install libint2-python-test
- name: Test Libint library - unit tests
Expand Down
17 changes: 15 additions & 2 deletions export/cmake/CMakeLists.txt.export
Original file line number Diff line number Diff line change
Expand Up @@ -191,8 +191,21 @@ set(LIBINT2_INSTALL_CMAKEDIR "lib/cmake/libint2"
file(STRINGS "${CMAKE_CURRENT_SOURCE_DIR}/srclist.cmake" LIBINT2_LIBRARY_CXX_SRC ENCODING UTF-8)
set(LIB_CXX_SRC )
foreach(FN IN LISTS LIBINT2_LIBRARY_CXX_SRC)
message(WARNING "found source file src/${FN}")
list(APPEND LIB_CXX_SRC "src/${FN}")
set(srcfile "${CMAKE_CURRENT_SOURCE_DIR}/src/${FN}")
if (MSVC)
string(REGEX REPLACE "[a-zA-Z0-9_.]" "" NONASCII_FN "${FN}")
if (NONASCII_FN)
message(WARNING "Non-ASCII characters in filename ${FN}")
string(MAKE_C_IDENTIFIER "${FN}" C_FN)
if (FN STREQUAL C_FN)
message(FATAL_ERROR "Non-ASCII characters in filename ${FN} but C identifier is the same")
endif()
file(CREATE_LINK "${CMAKE_CURRENT_SOURCE_DIR}/src/${FN}" "${CMAKE_CURRENT_SOURCE_DIR}/src/${C_FN}" SYMBOLIC)
message(WARNING "Created symbolic link ${CMAKE_CURRENT_SOURCE_DIR}/src/${C_FN} -> ${CMAKE_CURRENT_SOURCE_DIR}/src/${FN}")
set(srcfile "${CMAKE_CURRENT_SOURCE_DIR}/src/${C_FN}")
endif()
endif(MSVC)
list(APPEND LIB_CXX_SRC "${srcfile}")
endforeach()
# Create object files to use for static and shared libraries
add_library(libint2_obj OBJECT ${LIB_CXX_SRC} "src/configuration.cc")
Expand Down

0 comments on commit 9e5ba31

Please sign in to comment.