Skip to content

Commit 59fe9d7

Browse files
committed
skip Node build on Windows in CMake configuration
1 parent 971414b commit 59fe9d7

File tree

1 file changed

+12
-9
lines changed

1 file changed

+12
-9
lines changed

CMakeLists.txt

Lines changed: 12 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@ if(MSVC)
1818
set(CMAKE_CXX_FLAGS_RELEASE "${CMAKE_CXX_FLAGS_RELEASE} /MT")
1919
set(CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG} /MTd")
2020
set(CMAKE_MSVC_RUNTIME_LIBRARY "MultiThreaded$<$<CONFIG:Debug>:Debug>")
21+
set(NODE_SKIP TRUE) # Skip Node Build on Windows
2122
elseif(APPLE)
2223
add_definitions(-D_SQEEZ_MAC)
2324
set(CMAKE_OSX_ARCHITECTURES "arm64")
@@ -39,16 +40,18 @@ message(STATUS "C++ Compiler Version: ${CMAKE_CXX_COMPILER_VERSION}")
3940
include_directories(${CMAKE_CURRENT_SOURCE_DIR}/include)
4041

4142
# Include NodeJS
42-
include(./node_modules/node-cmake/NodeJS.cmake)
43-
nodejs_init()
43+
if (NOT NODE_SKIP)
44+
include(./node_modules/node-cmake/NodeJS.cmake)
45+
nodejs_init()
4446

45-
# After init, we will have headers required at the following folder:
46-
# ${CMAKE_CURRENT_BINARY_DIR}/node/${NODEJS_VERSION}/include
47-
include_directories(
48-
${CMAKE_JS_INC}
49-
"${CMAKE_CURRENT_BINARY_DIR}/node/${NODEJS_VERSION}/include"
50-
"${CMAKE_HOME_DIRECTORY}/node_modules/node-addon-api"
51-
)
47+
# After init, we will have headers required at the following folder:
48+
# ${CMAKE_CURRENT_BINARY_DIR}/node/${NODEJS_VERSION}/include
49+
include_directories(
50+
${CMAKE_JS_INC}
51+
"${CMAKE_CURRENT_BINARY_DIR}/node/${NODEJS_VERSION}/include"
52+
"${CMAKE_HOME_DIRECTORY}/node_modules/node-addon-api"
53+
)
54+
endif()
5255

5356
# Include Google Test
5457
include(FetchContent)

0 commit comments

Comments
 (0)