@@ -19,44 +19,48 @@ if(WIN32)
19
19
# https://discuss.python.org/t/windows-install-from-source-failing/25389/4
20
20
# --precompile causes problem with script hard-coded temporary directory
21
21
22
- else ()
23
- # Linux prereqs: https://devguide.python.org/setup/#linux
24
-
25
- # prereqs
26
- foreach (l IN ITEMS bzip2 expat ffi lzma readline ssl zlib)
27
- include (${l} .cmake)
28
- endforeach ()
29
-
30
- # Python build
31
- set (python_args
32
- --prefix =${CMAKE_INSTALL_PREFIX}
33
- CC=${CC}
34
- --with-system -expat
35
- )
36
- if (CMAKE_BUILD_TYPE STREQUAL "Release" )
37
- list (APPEND python_args --enable-optimizations)
38
- endif ()
22
+ return ()
23
+ endif ()
39
24
40
- set (python_cflags "${CMAKE_C_FLAGS} " )
41
- set (python_ldflags "${LDFLAGS} " )
25
+ # Linux prereqs: https://devguide.python.org/setup/#linux
42
26
43
- if (OPENSSL_FOUND)
44
- get_filename_component (openssl_dir ${OPENSSL_INCLUDE_DIR} DIRECTORY )
45
- list (APPEND python_args --with-openssl=${openssl_dir} )
46
- else ()
47
- list (APPEND python_args --with-openssl=${CMAKE_INSTALL_PREFIX} )
48
- endif ()
27
+ # prereqs
28
+ foreach (l IN ITEMS bzip2 expat ffi lzma readline ssl zlib)
29
+ include (${l} .cmake)
30
+ endforeach ()
49
31
50
- ExternalProject_Add(python
51
- ${python_download}
52
- CONFIGURE_COMMAND <SOURCE_DIR>/configure ${python_args} CFLAGS=${python_cflags} LDFLAGS=${python_ldflags}
53
- BUILD_COMMAND ${MAKE_EXECUTABLE} -j
54
- INSTALL_COMMAND ${MAKE_EXECUTABLE} -j install
55
- TEST_COMMAND ""
56
- CONFIGURE_HANDLED_BY_BUILD ON
57
- INACTIVITY_TIMEOUT 60
58
- DEPENDS "bzip2;expat;ffi;readline;ssl;xz;zlib"
59
- ${terminal_verbose}
60
- )
32
+ # Python build
33
+ set (python_args
34
+ --prefix =${CMAKE_INSTALL_PREFIX}
35
+ CC=${CC}
36
+ --with-system -expat
37
+ )
38
+ if (CMAKE_BUILD_TYPE STREQUAL "Release" )
39
+ list (APPEND python_args --enable-optimizations)
40
+ endif ()
61
41
42
+ set (python_cflags "${CMAKE_C_FLAGS} " )
43
+ set (python_ldflags "${LDFLAGS} " )
44
+
45
+ if (OPENSSL_FOUND)
46
+ get_filename_component (openssl_dir ${OPENSSL_INCLUDE_DIR} DIRECTORY )
47
+ list (APPEND python_args --with-openssl=${openssl_dir} )
48
+ else ()
49
+ list (APPEND python_args --with-openssl=${CMAKE_INSTALL_PREFIX} )
62
50
endif ()
51
+
52
+ message (STATUS "Python configure args: ${python_args} " )
53
+ message (STATUS "Python CFLAGS: ${python_cflags} " )
54
+ message (STATUS "Python LDFLAGS: ${python_ldflags} " )
55
+
56
+ ExternalProject_Add(python
57
+ ${python_download}
58
+ CONFIGURE_COMMAND <SOURCE_DIR>/configure ${python_args} CFLAGS=${python_cflags} LDFLAGS=${python_ldflags}
59
+ BUILD_COMMAND ${MAKE_EXECUTABLE} -j
60
+ INSTALL_COMMAND ${MAKE_EXECUTABLE} -j install
61
+ TEST_COMMAND ""
62
+ CONFIGURE_HANDLED_BY_BUILD ON
63
+ INACTIVITY_TIMEOUT 60
64
+ DEPENDS "bzip2;expat;ffi;readline;ssl;xz;zlib"
65
+ ${terminal_verbose}
66
+ )
0 commit comments