diff --git a/CMakeLists.txt b/CMakeLists.txt index 383524f..df27683 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -22,17 +22,17 @@ project( HOMEPAGE_URL https://github.com/bitdefender/bddisasm) # Use Release as the build type if no build type was specified and we're not using a multi-config generator . -if(NOT CMAKE_BUILD_TYPE AND NOT CMAKE_CONFIGURATION_TYPES) +if (NOT CMAKE_BUILD_TYPE AND NOT CMAKE_CONFIGURATION_TYPES) message(STATUS "No build type given. Will use 'Release'") set(CMAKE_BUILD_TYPE "Release" CACHE STRING "Choose the type of build." FORCE) # Set the possible values of build type for cmake-gui. set_property(CACHE CMAKE_BUILD_TYPE PROPERTY STRINGS "Debug" "Release") -endif() +endif () # These are shared by bddisasm and bdshemu. -if(NOT MSVC) +if (NOT MSVC) set(BDDISASM_COMMON_COMPILE_OPTIONS "$<$:-U_FORTIFY_SOURCE>" "$<$:-D_FORTIFY_SOURCE=2>" @@ -65,9 +65,9 @@ if(NOT MSVC) -gdwarf-4 -grecord-gcc-switches -march=westmere) -else() +else () set(BDDISASM_COMMON_COMPILE_OPTIONS /W4 /WX) -endif() +endif () set(BDDISASM_PUBLIC_HEADERS "inc/bddisasm.h" @@ -146,9 +146,9 @@ target_include_directories(bddisasm PUBLIC $") set(CPACK_DEBIAN_PACKAGE_DEPENDS "") @@ -241,4 +241,4 @@ if(${CMAKE_PROJECT_NAME} STREQUAL ${PROJECT_NAME}) set(CPACK_DEBIAN_PACKAGE_SECTION "devel") include(CPack) -endif() +endif () diff --git a/disasmtool/CMakeLists.txt b/disasmtool/CMakeLists.txt index 607c8dc..58c0e6c 100644 --- a/disasmtool/CMakeLists.txt +++ b/disasmtool/CMakeLists.txt @@ -3,27 +3,27 @@ cmake_minimum_required(VERSION 3.16) project(disasmtool LANGUAGES C) # Use Release as the build type if no build type was specified and we're not using a multi-config generator . -if(NOT CMAKE_BUILD_TYPE AND NOT CMAKE_CONFIGURATION_TYPES) +if (NOT CMAKE_BUILD_TYPE AND NOT CMAKE_CONFIGURATION_TYPES) message(STATUS "No build type given. Will use 'Release'") set(CMAKE_BUILD_TYPE "Release" CACHE STRING "Choose the type of build." FORCE) # Set the possible values of build type for cmake-gui. set_property(CACHE CMAKE_BUILD_TYPE PROPERTY STRINGS "Debug" "Release") -endif() +endif () add_executable(disasmtool disasmtool.c) target_link_libraries(disasmtool PRIVATE bddisasm::bddisasm bddisasm::bdshemu) -if("${CMAKE_BUILD_TYPE}" STREQUAL "Release") +if ("${CMAKE_BUILD_TYPE}" STREQUAL "Release") include(CheckIPOSupported) check_ipo_supported(RESULT USE_IPO) - if(USE_IPO) + if (USE_IPO) set_target_properties(bddisasm PROPERTIES INTERPROCEDURAL_OPTIMIZATION True) - endif() -endif() + endif () +endif () -if(NOT MSVC) +if (NOT MSVC) target_compile_options( disasmtool PRIVATE -Wall @@ -55,6 +55,6 @@ if(NOT MSVC) -gdwarf-4 -grecord-gcc-switches -march=westmere) -else() +else () target_compile_options(disasmtool PRIVATE /W4 /WX) -endif() +endif () diff --git a/disasmtool_lix/CMakeLists.txt b/disasmtool_lix/CMakeLists.txt index 9fbaaa1..2cbf531 100644 --- a/disasmtool_lix/CMakeLists.txt +++ b/disasmtool_lix/CMakeLists.txt @@ -3,14 +3,14 @@ cmake_minimum_required(VERSION 3.12) project(disasmtool LANGUAGES CXX) # Use Release as the build type if no build type was specified and we're not using a multi-config generator . -if(NOT CMAKE_BUILD_TYPE AND NOT CMAKE_CONFIGURATION_TYPES) +if (NOT CMAKE_BUILD_TYPE AND NOT CMAKE_CONFIGURATION_TYPES) message(STATUS "No build type given. Will use 'Release'") set(CMAKE_BUILD_TYPE "Release" CACHE STRING "Choose the type of build." FORCE) # Set the possible values of build type for cmake-gui. set_property(CACHE CMAKE_BUILD_TYPE PROPERTY STRINGS "Debug" "Release") -endif() +endif () add_executable(disasmtool disasmtool.cpp dumpers.cpp) @@ -43,20 +43,20 @@ target_compile_options( find_package(RapidJSON QUIET) target_link_libraries(disasmtool PRIVATE bddisasm::bddisasm bddisasm::bdshemu) -if(RapidJSON_FOUND) +if (RapidJSON_FOUND) # :( https://github.com/satishbabariya/modern-cmake#good-boys-export-their-targets target_include_directories(disasmtool PRIVATE ${RapidJSON_INCLUDE_DIRS}) target_sources(disasmtool PRIVATE rapidjson.cpp) target_compile_definitions(disasmtool PRIVATE HAS_RAPIDJSON) -endif() +endif () -if("${CMAKE_BUILD_TYPE}" STREQUAL "Release") +if ("${CMAKE_BUILD_TYPE}" STREQUAL "Release") include(CheckIPOSupported) check_ipo_supported(RESULT USE_IPO) - if(USE_IPO) + if (USE_IPO) set_target_properties(bddisasm PROPERTIES INTERPROCEDURAL_OPTIMIZATION True) - endif() -endif() + endif () +endif () set_target_properties( disasmtool diff --git a/isagenerator/CMakeLists.txt b/isagenerator/CMakeLists.txt index f22bf08..144d3c3 100644 --- a/isagenerator/CMakeLists.txt +++ b/isagenerator/CMakeLists.txt @@ -5,10 +5,10 @@ project(isagenerator) include(FindPython3) find_package(Python3 COMPONENTS Interpreter) -if(Python3_FOUND) +if (Python3_FOUND) add_custom_target( isagenerator COMMAND Python3::Interpreter generate_tables.py instructions WORKING_DIRECTORY "${CMAKE_CURRENT_LIST_DIR}" COMMENT "Generating instruction tables") -endif(Python3_FOUND) +endif (Python3_FOUND)