@@ -40,8 +40,28 @@ if (CMAKE_SYSTEM_NAME STREQUAL Windows)
4040 # add_link_options(-INTEGRITYCHECK) # require signatures of libs, only recommended
4141endif ()
4242if (CMAKE_SYSTEM_NAME STREQUAL Linux)
43- add_compile_options (-D_FORTIFY_SOURCE=2 -Wformat -Wformat-security -Werror=format-security -fno-delete-null-pointer-checks -fstack-protector-strong -fno-strict-overflow -Wall)
44- add_compile_options (-fstack-clash-protection -fcf-protection=full) # v8.0 and newer
43+ string (CONCAT WARN_FLAGS
44+ "-Wall "
45+ "-Wextra "
46+ "-Winit-self "
47+ "-Wunused-function "
48+ "-Wuninitialized "
49+ "-Wmissing-declarations "
50+ "-fdiagnostics-color=auto "
51+ "-Wno-deprecated-declarations "
52+ )
53+ string (CONCAT SDL_FLAGS
54+ "-D_FORTIFY_SOURCE=2 "
55+ "-Wformat "
56+ "-Wformat-security "
57+ "-Werror=format-security "
58+ "-fno-delete-null-pointer-checks "
59+ "-fstack-protector-strong "
60+ "-fno-strict-overflow "
61+ "-fstack-clash-protection "
62+ "-fcf-protection=full "
63+ )
64+ set (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${WARN_FLAGS} ${SDL_FLAGS} " )
4565 # add_compile_options(-mcet) # v8.0 and newer # unrecognized command line option '-mcet', only recommended
4666 add_link_options (-Wl,-z,noexecstack,-z,relro,-z,now)
4767endif ()
@@ -51,18 +71,32 @@ if (CMAKE_SYSTEM_NAME STREQUAL Darwin)
5171 # add_compile_options(-mcet) # v8.0 and newer # unrecognized command line option '-mcet', only recommended
5272endif ()
5373
54- option (DPNP_ENABLE "Use DPNP for some math functions" OFF )
55- option (GPU_ENABLE "Enable GPU codegen" OFF )
56- option (NUMBA_ENABLE "Enable numba-based python frontend" OFF )
57- option (TBB_ENABLE "Enable TBB" OFF )
58-
59- message (STATUS "DPNP_ENABLE ${DPNP_ENABLE} " )
60- message (STATUS "GPU_ENABLE ${GPU_ENABLE} " )
61- message (STATUS "BUILD_TESTING ${BUILD_TESTING} " )
62- message (STATUS "NUMBA_ENABLE ${NUMBA_ENABLE} " )
63- message (STATUS "TBB_ENABLE ${TBB_ENABLE} " )
74+ option (IMEX_USE_DPNP
75+ "Use the dpnp Python NumPy-like library for some math functions"
76+ OFF
77+ )
78+ option (IMEX_ENABLE_IGPU_DIALECT
79+ "Enable GPU codegen"
80+ OFF
81+ )
82+ option (IMEX_ENABLE_NUMBA_FE
83+ "Enable numba-based python frontend"
84+ OFF
85+ )
86+ option (IMEX_ENABLE_TBB_SUPPORT
87+ "Enable TBB"
88+ OFF
89+ )
90+ option (IMEX_ENABLE_TESTS
91+ "Enable CTests"
92+ OFF
93+ )
6494
65- include (CTest)
95+ message (STATUS "IMEX_USE_DPNP ${DPNIMEX_USE_DPNPP_ENABLE} " )
96+ message (STATUS "IMEX_ENABLE_IGPU_DIALECT ${IMEX_ENABLE_IGPU_DIALECT} " )
97+ message (STATUS "IMEX_ENABLE_TESTS ${IMEX_ENABLE_TESTS} " )
98+ message (STATUS "IMEX_ENABLE_NUMBA_FE ${IMEX_ENABLE_NUMBA_FE} " )
99+ message (STATUS "IMEX_ENABLE_TBB_SUPPORT ${IMEX_ENABLE_TBB_SUPPORT} " )
66100
67101macro (apply_llvm_compile_flags target )
68102 if (MSVC )
@@ -71,7 +105,7 @@ macro(apply_llvm_compile_flags target)
71105 target_compile_definitions (${target} PRIVATE ${LLVM_DEFINITIONS} )
72106endmacro ()
73107
74- if (GPU_ENABLE )
108+ if (IMEX_ENABLE_IGPU_DIALECT )
75109 if (DEFINED ENV{LEVEL_ZERO_VERSION_CHECK_OFF})
76110 find_package (LevelZero REQUIRED)
77111 else ()
@@ -84,10 +118,11 @@ add_subdirectory(mlir)
84118add_subdirectory (dpcomp_runtime)
85119add_subdirectory (tools)
86120
87- if (NUMBA_ENABLE )
121+ if (IMEX_ENABLE_NUMBA_FE )
88122 add_subdirectory (numba_dpcomp)
89123endif ()
90124
91- if (BUILD_TESTING)
125+ if (IMEX_ENABLE_TESTS)
126+ include (CTest)
92127 add_subdirectory (test )
93128endif ()
0 commit comments