Skip to content

Commit

Permalink
Merge pull request #3 from ad3154/cmake-improvements
Browse files Browse the repository at this point in the history
Minor CMake Enhancements
  • Loading branch information
rusoku authored Jun 9, 2023
2 parents 0505b37 + 131a8fb commit a9d8560
Showing 1 changed file with 13 additions and 9 deletions.
22 changes: 13 additions & 9 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,22 +1,26 @@
cmake_minimum_required(VERSION 3.24)
set(CMAKE_POLICY_DEFAULT_CMP0091 NEW)

project(canal)
project(canal VERSION 1.0.5 LANGUAGES CXX C)

set(CMAKE_C_STANDARD 11)
set(CMAKE_CXX_STANDARD 11)

set(CMAKE_C_COMPILER)
set(CMAKE_CXX_COMPILER)

#add_definitions(-DUNICODE)
#add_definitions(-D_UNICODE)
add_definitions(-D_MBCS)
add_definitions(-D_WIN32_WINNT_WIN10)
if(NOT MSVC)
#add_definitions(-DUNICODE)
#add_definitions(-D_UNICODE)
add_definitions(-D_MBCS)
add_definitions(-D_WIN32_WINNT_WIN10)
endif()

#add_compile_options(-Wall -Wextra -Wpedantic)
add_compile_options(-Wno-pragma-once-outside-header)
add_compile_options(-Wno-unused-parameter)
if(CMAKE_COMPILER_IS_GNUCXX OR CMAKE_CXX_COMPILER_ID MATCHES "Clang")
#add_compile_options(-Wall -Wextra -Wpedantic)
add_compile_options(-Wno-pragma-once-outside-header)
add_compile_options(-Wno-unused-parameter)
endif()

if(${CMAKE_BUILD_TYPE} STREQUAL "Debug")
#add_compile_definitions(canal DEBUG_CANAL)
Expand All @@ -42,7 +46,7 @@ add_library(canal SHARED
set_property(TARGET canal PROPERTY
MSVC_RUNTIME_LIBRARY "MultiThreaded$<$<CONFIG:Debug>:Debug>")

target_link_libraries(canal cfgmgr32 winusb)
target_link_libraries(canal PRIVATE cfgmgr32 winusb)
set_target_properties(canal PROPERTIES OUTPUT_NAME "canal$<$<CONFIG:Debug>:d>")


Expand Down

0 comments on commit a9d8560

Please sign in to comment.