Skip to content

Commit 1088917

Browse files
committed
Fix to allow build in VS2019
1 parent 4ce7df9 commit 1088917

File tree

3 files changed

+15
-1
lines changed

3 files changed

+15
-1
lines changed

.gitignore

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -106,3 +106,9 @@ htmlcov
106106

107107
#Dynamic Library
108108
*.dylib
109+
110+
#Visual Studio CMake Project
111+
/.vs/
112+
CMakeSettings.json
113+
/out/
114+
/openmc/lib/*.lib

CMakeLists.txt

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -325,8 +325,11 @@ else()
325325
add_library(libopenmc SHARED ${libopenmc_SOURCES})
326326
endif()
327327

328+
# Avoid vs error lnk1149 :output filename matches input filename
329+
if(NOT MSVC)
328330
set_target_properties(libopenmc PROPERTIES
329-
OUTPUT_NAME openmc)
331+
OUTPUT_NAME openmc)
332+
endif()
330333

331334
target_include_directories(libopenmc
332335
PUBLIC

src/source.cpp

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -386,7 +386,12 @@ void load_custom_source_library()
386386

387387
void close_custom_source_library()
388388
{
389+
#ifdef HAS_DYNAMIC_LINKING
389390
dlclose(custom_source_library);
391+
#else
392+
fatal_error("Custom source libraries have not yet been implemented for "
393+
"non-POSIX systems");
394+
#endif
390395
}
391396

392397
Particle::Bank sample_custom_source_library(uint64_t* seed)

0 commit comments

Comments
 (0)