diff options
| -rw-r--r-- | CMakeLists.txt | 12 | ||||
| -rw-r--r-- | main.c | 11 |
2 files changed, 6 insertions, 17 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt index f6fc67c..840b4c2 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -46,14 +46,14 @@ include(CheckIPOSupported) include(CheckIncludeFile) include(CheckSymbolExists) -# Check for IPO/LTO -check_ipo_supported(RESULT supported) - # Unit testing and coverage configuration set(TESTING ON CACHE BOOL "Enable unit-testing") set(COVERAGE OFF CACHE BOOL "Enable coverage") -if(supported) +# Check for IPO/LTO +check_ipo_supported(RESULT LTO_SUPPORTED) + +if(LTO_SUPPORTED) message(STATUS "IPO/LTO enabled") set(CMAKE_INTERPROCEDURAL_OPTIMIZATION TRUE) endif() @@ -135,9 +135,9 @@ target_link_libraries(BHLib PUBLIC m) # Enable all compiler warnings if(MSVC) - target_compile_options(BHLib PRIVATE /W4 /WX) + target_compile_options(BHLib PRIVATE /W4 /WX) else() - target_compile_options(BHLib PRIVATE -Wall -Wextra -Wpedantic -Werror -fstrict-aliasing) + target_compile_options(BHLib PRIVATE -Wall -Wextra -Wpedantic -Werror -fstrict-aliasing) endif() # Coverage @@ -1,11 +0,0 @@ -#include <bh/io.h> - -int main() -{ - BH_IO *io = BH_FileNew("hello.txt"); - BH_IOOpen(io, BH_IO_WRITE); - BH_IOWrite(io, "Hello, world!", 13, NULL); - BH_IOFree(io); - - return 0; -}
\ No newline at end of file |
