Skip to content

Commit

Permalink
add preprocessor definitions to address windows incompatibilites
Browse files Browse the repository at this point in the history
  • Loading branch information
dsuedholt committed Jan 7, 2025
1 parent 0601552 commit 2630476
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 1 deletion.
9 changes: 9 additions & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -73,12 +73,21 @@ elseif (CMAKE_SYSTEM_NAME STREQUAL "Windows")
set(SDT_LIB_FILE "${SDT_BASE_DIR}/lib/libSDT64.dll")
set(WHEELS_LIB_DIR "")
add_library(sdt UNKNOWN IMPORTED)

else()
message(FATAL_ERROR "Unsupported platform")
endif()

FetchContent_MakeAvailable(sdtlib)

if (CMAKE_SYSTEM_NAME STREQUAL "Windows")
foreach(headerFile "SDTGases.h" "SDTLiquids.h")
file(READ "${SDT_HEADER_DIR}/${headerFile}" headerContent)
string(CONCAT headerContent "#define __attribute__(...)\n" "${headerContent}")
file(WRITE "${SDT_HEADER_DIR}/${headerFile}" "${headerContent}")
endforeach()
endif()

get_filename_component(SDT_LIB_NAME "${SDT_LIB_FILE}" NAME)

file(RENAME ${SDT_LIB_FILE} ${CMAKE_CURRENT_BINARY_DIR}/${SDT_LIB_NAME})
Expand Down
1 change: 0 additions & 1 deletion src/wrappers/Liquids.h
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
#include <SDTLiquids.h>
#include "WrapperMacros.h"


namespace sdtwrappers {
class Bubble {
public:
Expand Down

0 comments on commit 2630476

Please sign in to comment.