Skip to content

Commit

Permalink
replace add_definitions call with target_compile_definitions
Browse files Browse the repository at this point in the history
  • Loading branch information
alextwothousand authored Aug 5, 2021
1 parent d409d2d commit 726bb19
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,6 +1,12 @@
cmake_minimum_required(VERSION 3.0)
project(enet C)

# defaults
set(ENET_STATIC ON)
set(ENET_SHARED OFF)
set(ENET_TEST OFF)

# configure projects
if (ENET_STATIC)
add_library(enet STATIC test/library.c)

Expand All @@ -10,7 +16,7 @@ if (ENET_STATIC)
endif()

if (ENET_SHARED)
add_definitions(-DENET_DLL)
target_compile_definitions(enet PUBLIC -DENET_DLL)
add_library(enet SHARED test/library.c)

if (WIN32)
Expand Down

0 comments on commit 726bb19

Please sign in to comment.