@@ -269,8 +269,6 @@ add_executable(unittests_ ${UNITTEST_SOURCES})
269269target_link_libraries (python-cpp
270270 PUBLIC spdlog m
271271 PRIVATE
272- project_options
273- project_warnings
274272 ICU::uc
275273 ICU::data
276274 ${GMPXX_LIBRARIES}
@@ -283,11 +281,7 @@ target_include_directories(python-cpp
283281 PRIVATE ${GMP_INCLUDES} ${CMAKE_CURRENT_BINARY_DIR }
284282)
285283
286- target_compile_options (
287- python-cpp
288- PRIVATE
289- # -fno-omit-frame-pointer is needed, otherwise we cannot access the stack base pointer reliably
290- -fno-omit-frame-pointer )
284+ python_cpp_link_project_options (python-cpp )
291285
292286if (STL_SUPPORTS_BIT_CAST)
293287 target_compile_definitions (python-cpp PUBLIC "STL_SUPPORTS_BIT_CAST" )
@@ -312,14 +306,6 @@ elseif(ENABLE_LLVM_BACKEND AND LLVM_FOUND)
312306 message (STATUS "Configuring LLVM backend" )
313307 add_library (python-cpp-llvm ${LLVM_BACKEND_FILES} )
314308
315- target_compile_options (
316- python-cpp-llvm
317- PRIVATE -Wall
318- -Wextra
319- -Werror
320- -Wno-unused-parameter
321- -fno-omit-frame-pointer )
322-
323309 add_library (llvm-interface INTERFACE )
324310 target_include_directories (llvm-interface INTERFACE . )
325311 # include llvm include directories as system paths to silence compiler warnings
@@ -337,7 +323,8 @@ elseif(ENABLE_LLVM_BACKEND AND LLVM_FOUND)
337323 orcjit
338324 x86asmparser
339325 x86codegen )
340- target_link_libraries (llvm-interface INTERFACE ${llvm_libs} project_options project_warnings )
326+ target_link_libraries (llvm-interface INTERFACE ${llvm_libs} )
327+ python_cpp_link_project_options (llvm-interface )
341328 # TODO: not all versions of llvm are ready for C++20, figure out when to use this
342329 set_property (TARGET python-cpp-llvm PROPERTY CXX_STANDARD 17)
343330
@@ -355,12 +342,14 @@ elseif(ENABLE_LLVM_BACKEND AND LLVM_FOUND)
355342 target_link_libraries (unittests_ PRIVATE python-cpp-llvm )
356343endif ()
357344
358- target_link_libraries (unittests_ PRIVATE python-cpp gtest gtest_main cxxopts project_options project_warnings tsl::ordered_map )
345+ target_link_libraries (unittests_ PRIVATE python-cpp gtest gtest_main cxxopts tsl::ordered_map )
359346gtest_discover_tests (unittests_ )
360347
361348add_executable (python repl/repl.cpp )
362- target_link_libraries (python PRIVATE linenoise cxxopts python-cpp project_options project_warnings stdc++ )
349+ target_link_libraries (python PRIVATE linenoise cxxopts python-cpp stdc++ )
363350
364351add_executable (freeze utilities/freeze.cpp )
365- target_link_libraries (freeze PRIVATE python-cpp cxxopts project_options project_warnings )
352+ target_link_libraries (freeze PRIVATE python-cpp cxxopts )
366353target_include_directories (freeze SYSTEM PRIVATE ${MLIR_INCLUDE_DIRS} )
354+
355+ python_cpp_link_project_options (unittests_ python freeze )
0 commit comments