Enable optimization flags and warnings for GNU/Clang compilers and tidy up compile options.
This commit is contained in:
@@ -30,8 +30,14 @@ target_include_directories(ikv_obj
|
||||
target_compile_features(ikv_obj PUBLIC c_std_99)
|
||||
set_target_properties(ikv_obj PROPERTIES
|
||||
POSITION_INDEPENDENT_CODE ON
|
||||
)
|
||||
|
||||
|
||||
# Enable optimization and extra warnings for GNU/Clang compilers
|
||||
if (CMAKE_C_COMPILER_ID STREQUAL "GNU" OR CMAKE_C_COMPILER_ID STREQUAL "Clang")
|
||||
add_compile_options(-O2 -Wall -Wextra -Wpedantic)
|
||||
endif()
|
||||
|
||||
#add_compile_options
|
||||
add_library(ikv STATIC)
|
||||
add_library(ikv::ikv ALIAS ikv)
|
||||
target_sources(ikv PRIVATE $<TARGET_OBJECTS:ikv_obj>)
|
||||
|
||||
Reference in New Issue
Block a user