Skip to content

Commit 1a6bba0

Browse files
Merge pull request #1131 from IntelPython/cmake-tweaks
Added -Wstrict-prototypes, removed -fno-strict-overflow
2 parents ef40014 + 4f74938 commit 1a6bba0

File tree

3 files changed

+13
-3
lines changed

3 files changed

+13
-3
lines changed

CMakeLists.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@ set(CMAKE_CXX_STANDARD 17)
1313
set(CMAKE_CXX_STANDARD_REQUIRED True)
1414
set(CMAKE_FIND_ROOT_PATH_MODE_INCLUDE BOTH)
1515
set(CMAKE_FIND_ROOT_PATH_MODE_LIBRARY BOTH)
16+
# set_property(GLOBAL PROPERTY GLOBAL_DEPENDS_DEBUG_MODE 1)
1617

1718
# Option to generate code coverage report using llvm-cov and lcov.
1819
option(DPCTL_GENERATE_COVERAGE

dpctl/CMakeLists.txt

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@ if(WIN32)
1313
"-Wunused-function "
1414
"-Wuninitialized "
1515
"-Wmissing-declarations "
16+
"-Wstrict-prototypes "
1617
"-Wno-unused-parameter "
1718
)
1819
string(CONCAT SDL_FLAGS
@@ -36,6 +37,8 @@ elseif(UNIX)
3637
"-Wunused-function "
3738
"-Wuninitialized "
3839
"-Wmissing-declarations "
40+
"-Wstrict-prototypes "
41+
"-Wno-unused-parameter "
3942
"-fdiagnostics-color=auto "
4043
)
4144
string(CONCAT SDL_FLAGS
@@ -46,7 +49,7 @@ elseif(UNIX)
4649
"-D_FORTIFY_SOURCE=2 "
4750
"-Wformat "
4851
"-Wformat-security "
49-
"-fno-strict-overflow "
52+
# "-fno-strict-overflow " # no-strict-overflow is implied by -fwrapv
5053
"-fno-delete-null-pointer-checks "
5154
"-fwrapv "
5255
)
@@ -137,9 +140,11 @@ set(CMAKE_INSTALL_RPATH "$ORIGIN")
137140

138141
function(build_dpctl_ext _trgt _src _dest)
139142
add_cython_target(${_trgt} ${_src} CXX OUTPUT_VAR _generated_src)
143+
set(_cythonize_trgt "${_trgt}_cythonize_pyx")
144+
add_custom_target(${_cythonize_trgt} DEPENDS ${_src})
140145
add_library(${_trgt} MODULE ${_generated_src})
141146
target_include_directories(${_trgt} PRIVATE ${NumPy_INCLUDE_DIR} ${DPCTL_INCLUDE_DIR})
142-
add_dependencies(${_trgt} _build_time_create_dpctl_include_copy)
147+
add_dependencies(${_trgt} _build_time_create_dpctl_include_copy ${_cythonize_trgt})
143148
if (DPCTL_GENERATE_COVERAGE)
144149
target_compile_definitions(${_trgt} PRIVATE CYTHON_TRACE=1 CYTHON_TRACE_NOGIL=1)
145150
target_compile_options(${_trgt} PRIVATE -fno-sycl-use-footer)

libsyclinterface/CMakeLists.txt

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -110,6 +110,8 @@ if(WIN32)
110110
"-Wunused-function "
111111
"-Wuninitialized "
112112
"-Wmissing-declarations "
113+
"-Wstrict-prototypes "
114+
"-Wno-unused-parameter "
113115
)
114116
string(CONCAT SDL_FLAGS
115117
"/GS "
@@ -131,6 +133,8 @@ elseif(UNIX)
131133
"-Wunused-function "
132134
"-Wuninitialized "
133135
"-Wmissing-declarations "
136+
"-Wstrict-prototypes "
137+
"-Wno-unused-parameter "
134138
"-fdiagnostics-color=auto "
135139
)
136140
string(CONCAT SDL_FLAGS
@@ -141,7 +145,7 @@ elseif(UNIX)
141145
"-D_FORTIFY_SOURCE=2 "
142146
"-Wformat "
143147
"-Wformat-security "
144-
"-fno-strict-overflow "
148+
# "-fno-strict-overflow " # implied by -fwrapv
145149
"-fno-delete-null-pointer-checks "
146150
"-fwrapv "
147151
)

0 commit comments

Comments
 (0)