Skip to content

Commit af01a03

Browse files
committed
Increase heap space on MSVC
1 parent b46cf76 commit af01a03

File tree

1 file changed

+21
-17
lines changed

1 file changed

+21
-17
lines changed

CMakeLists.txt

+21-17
Original file line numberDiff line numberDiff line change
@@ -84,6 +84,23 @@ file(GLOB_RECURSE LIBRAPID_SOURCES
8484
"${CMAKE_CURRENT_SOURCE_DIR}/librapid/cxxblas/*.cxx" # Source files
8585
)
8686

87+
# Extract system information
88+
set(IS_LINUX OFF)
89+
set(IS_MACOS OFF)
90+
set(IS_WINDOWS OFF)
91+
if (CMAKE_SYSTEM_NAME STREQUAL "Linux")
92+
set(IS_LINUX ON)
93+
endif ()
94+
if (CMAKE_SYSTEM_NAME STREQUAL "Darwin")
95+
set(IS_MACOS ON)
96+
endif ()
97+
if (CMAKE_SYSTEM_NAME STREQUAL "Windows")
98+
set(IS_WINDOWS ON)
99+
100+
# Disable shared libraries, since they just cause problems on Windows
101+
set(BUILD_SHARED_LIBS OFF CACHE BOOL "Build shared libraries" FORCE)
102+
endif ()
103+
87104
if (${SKBUILD})
88105
message(STATUS "[ LIBRAPID ] Building for Python")
89106
set(module_name "_librapid")
@@ -164,6 +181,10 @@ if (${SKBUILD})
164181
${PYTHON_SOURCES}
165182
)
166183

184+
if (MSVC)
185+
target_compile_options(${module_name} PUBLIC /Zm200)
186+
endif ()
187+
167188
target_compile_definitions(${module_name} PUBLIC
168189
LIBRAPID_PYTHON
169190
WIN32_LEAN_AND_MEAN
@@ -189,23 +210,6 @@ if (LIBRAPID_USE_PRECOMPILED_HEADER)
189210
target_precompile_headers(${module_name} PRIVATE "${CMAKE_CURRENT_SOURCE_DIR}/librapid/include/librapid/core/librapidPch.hpp")
190211
endif ()
191212

192-
# Extract system information
193-
set(IS_LINUX OFF)
194-
set(IS_MACOS OFF)
195-
set(IS_WINDOWS OFF)
196-
if (CMAKE_SYSTEM_NAME STREQUAL "Linux")
197-
set(IS_LINUX ON)
198-
endif ()
199-
if (CMAKE_SYSTEM_NAME STREQUAL "Darwin")
200-
set(IS_MACOS ON)
201-
endif ()
202-
if (CMAKE_SYSTEM_NAME STREQUAL "Windows")
203-
set(IS_WINDOWS ON)
204-
205-
# Disable shared libraries, since they just cause problems on Windows
206-
set(BUILD_SHARED_LIBS OFF CACHE BOOL "Build shared libraries" FORCE)
207-
endif ()
208-
209213
if (MINGW)
210214
message(FATAL_ERROR "LibRapid does not compile with MinGW. Please use MSVC or Clang instead.")
211215
endif ()

0 commit comments

Comments
 (0)