Skip to content

Commit

Permalink
take 14
Browse files Browse the repository at this point in the history
  • Loading branch information
loriab committed Jan 7, 2024
1 parent 39ff01a commit 1907a83
Show file tree
Hide file tree
Showing 2 changed files with 28 additions and 15 deletions.
4 changes: 2 additions & 2 deletions src/bin/libint/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -39,15 +39,15 @@ target_compile_definitions(
libint-libcompiler
PUBLIC
__COMPILING_LIBINT2=1
# MSVC does not include <cmath> constants, unless _USE_MATH_DEFINES is defined.
$<$<BOOL:${MSVC}>:_USE_MATH_DEFINES>
# MSVC does not include <cmath> constants, unless _USE_MATH_DEFINES is defined.
)

target_compile_options(
libint-libcompiler
PUBLIC
$<$<BOOL:${MSVC}>:/EHsc>
# Set the exception handling model (allows "throw")
$<$<BOOL:${MSVC}>:"/EHsc">
)

target_compile_features(
Expand Down
39 changes: 26 additions & 13 deletions src/lib/libint/CMakeLists.txt.export
Original file line number Diff line number Diff line change
Expand Up @@ -173,6 +173,11 @@ list(LENGTH LIBINT2_LIBRARY_CXX_SRC _source_count)
message(STATUS "Loading ${_source_count} library source files from LIBINT2_LIBRARY_CXX_SRC")
message(DEBUG "LIBINT2_LIBRARY_CXX_SRC=${LIBINT2_LIBRARY_CXX_SRC}")

# Notes
# * __COMPILING_LIBINT2 is needed whenever using libint targets in the build tree
# * MSVC does not include <cmath> constants, unless _USE_MATH_DEFINES is defined
# * /EHsc sets the exception handling model (allows "throw")

add_library(
int-obj
OBJECT
Expand All @@ -193,8 +198,7 @@ target_compile_features(
set_target_properties(
int-obj
PROPERTIES
UNITY_BUILD TRUE
# always use unity build for int-obj
UNITY_BUILD TRUE # always use unity build for int-obj
)
target_include_directories(
int-obj
Expand All @@ -205,6 +209,16 @@ target_include_directories(
${PROJECT_SOURCE_DIR}/include/libint2/
)

if (MSVC)
set_target_properties(
int-obj
PROPERTIES
LINK_FLAGS "/STACK:4194304"
# Increase stack size from 1 MB to 4 MB
)
endif()


if (BUILD_SHARED_LIBS OR LIBINT2_BUILD_SHARED_AND_STATIC_LIBS)
set(BUILD_SHARED_LIBS 1)
set_target_properties(
Expand Down Expand Up @@ -233,13 +247,13 @@ if (BUILD_SHARED_LIBS)
int-shared
INTERFACE
$<BUILD_INTERFACE:__COMPILING_LIBINT2=1>
# need __COMPILING_LIBINT2 whenever using libint targets in the build tree
PUBLIC
$<$<BOOL:${MSVC}>:_USE_MATH_DEFINES>
)

set_target_properties(
target_compile_options(
int-shared
PROPERTIES
OUTPUT_NAME "int2"
PUBLIC
$<$<BOOL:${MSVC}>:/EHsc>
)
target_include_directories(
int-shared
Expand All @@ -249,7 +263,11 @@ if (BUILD_SHARED_LIBS)
$<BUILD_INTERFACE:${PROJECT_BINARY_DIR}/include>
$<BUILD_INTERFACE:${PROJECT_BINARY_DIR}/include/libint2>
)

set_target_properties(
int-shared
PROPERTIES
OUTPUT_NAME "int2"
)
endif()

if (BUILD_STATIC_LIBS)
Expand All @@ -269,13 +287,11 @@ if (BUILD_STATIC_LIBS)
INTERFACE
$<BUILD_INTERFACE:__COMPILING_LIBINT2=1>
PUBLIC
# MSVC does not include <cmath> constants, unless _USE_MATH_DEFINES is defined.
$<$<BOOL:${MSVC}>:_USE_MATH_DEFINES>
)
target_compile_options(
int-static
PUBLIC
# Set the exception handling model (allows "throw")
$<$<BOOL:${MSVC}>:/EHsc>
)
target_include_directories(
Expand All @@ -291,9 +307,6 @@ if (BUILD_STATIC_LIBS)
PROPERTIES
OUTPUT_NAME "int2"
)


# target_compile_definitions(int-static PUBLIC _USE_MATH_DEFINES)
endif()

# Permanent aliases =============================================================
Expand Down

0 comments on commit 1907a83

Please sign in to comment.