(Finally) fix win32 build
This commit is contained in:
parent
75674f5beb
commit
b070909343
1 changed files with 7 additions and 4 deletions
|
@ -7,14 +7,17 @@ add_library(${PROJECT_NAME} SHARED ${SOURCE_FILES} ${CMAKE_JS_SRC})
|
|||
set_target_properties(${PROJECT_NAME} PROPERTIES PREFIX "" SUFFIX ".node")
|
||||
target_link_libraries(${PROJECT_NAME} ${CMAKE_JS_LIB})
|
||||
target_compile_features(${PROJECT_NAME} PRIVATE cxx_std_17)
|
||||
if(MSVC) # todo: change flags for parity with GCC/clang, I don't know much about MSVC and these arguments cause the build to fail so pull requests are open
|
||||
#set(CMAKE_CXX_FLAGS "/Wall /EHsc /GS")
|
||||
if(MSVC) # todo: change flags for more parity with GCC/clang, I don't know much about MSVC so pull requests are open
|
||||
set(CMAKE_CXX_FLAGS "/Wall /EHsc /GS")
|
||||
set(CMAKE_CXX_FLAGS_DEBUG "/Zi")
|
||||
set(CMAKE_CXX_FLAGS_RELEASE "/Ox")
|
||||
set(CMAKE_WINDOWS_EXPORT_ALL_SYMBOLS ON)
|
||||
set(BUILD_SHARED_LIBS TRUE)
|
||||
else()
|
||||
set(CMAKE_CXX_FLAGS "-Wall -Wextra -Werror=format-security -Wno-cast-function-type -fexceptions -D_GLIBCXX_ASSERTIONS -fstack-clash-protection -pedantic -D_GLIBCXX_USE_CXX11_ABI=1")
|
||||
set(CMAKE_CXX_FLAGS_DEBUG "-g")
|
||||
endif()
|
||||
set(CMAKE_CXX_FLAGS_RELEASE "-O3")
|
||||
endif()
|
||||
add_definitions(-DNAPI_VERSION=5)
|
||||
|
||||
execute_process(COMMAND node -p "require('node-addon-api').include"
|
||||
|
@ -25,7 +28,7 @@ string(REPLACE "\n" "" NODE_ADDON_API_DIR ${NODE_ADDON_API_DIR})
|
|||
string(REPLACE "\"" "" NODE_ADDON_API_DIR ${NODE_ADDON_API_DIR})
|
||||
target_include_directories(${PROJECT_NAME} PRIVATE ${NODE_ADDON_API_DIR})
|
||||
|
||||
find_package(ImageMagick COMPONENTS Magick++)
|
||||
find_package(ImageMagick COMPONENTS Magick++ MagickCore)
|
||||
add_definitions(-DMAGICKCORE_QUANTUM_DEPTH=16)
|
||||
add_definitions(-DMAGICKCORE_HDRI_ENABLE=0)
|
||||
include_directories(${ImageMagick_INCLUDE_DIRS})
|
||||
|
|
Loading…
Reference in a new issue