From 89beab3506ce97e149ba77c8b927d7b44a9d9eb8 Mon Sep 17 00:00:00 2001 From: Kasper Sauramo Date: Thu, 27 Mar 2025 12:31:53 +0200 Subject: [PATCH] Specify compiler options only for C --- CMakeLists.txt | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 09601ad..823d5df 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -15,8 +15,6 @@ endif() # Common compile options add_compile_options("-fvisibility=hidden") -# TODO: Get -Wpadded back somehow. -add_compile_options("-Wno-declaration-after-statement" "-Wno-padded") # Handle 3rd party dependencies # ############################# @@ -53,10 +51,12 @@ add_library(hiload SHARED # dependencies src/logger/sc_log.c ) - +# TODO: Get -Wpadded back by refactoring sc_array or just surround +# all type sc_array declarations with the ignore pragma target_compile_options(hiload PRIVATE $<$:-Wall -Wextra> $<$:-Weverything> + $<$:-Wno-declaration-after-statement -Wno-padded> ) target_link_libraries(hiload dl) @@ -93,10 +93,12 @@ add_library(auditor-x86_64 SHARED src/auditor/auditor-x86_64.c ) -target_compile_options(hiload PRIVATE +target_compile_options(auditor-x86_64 PRIVATE $<$:-Wall -Wextra> $<$:-Weverything> ) +target_compile_options(auditor-x86_64 PRIVATE + -Wno-unused-parameter) install(TARGETS auditor-x86_64 EXPORT auditor-x86_64Targets