Skip to content

Commit

Permalink
support CMake older than 3.19 which doesn't allow defining INTERFACE …
Browse files Browse the repository at this point in the history
…library type with explicit source list
  • Loading branch information
cosmin committed Jul 31, 2023
1 parent c750a78 commit 48de724
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 3 deletions.
5 changes: 3 additions & 2 deletions packager/utils/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,9 @@
# license that can be found in the LICENSE file or at
# https://developers.google.com/open-source/licenses/bsd

add_library(utils_clock INTERFACE
clock.h)
add_library(utils_clock STATIC
clock.h
clock.cc)

add_library(utils_test_clock STATIC
test_clock.cc
Expand Down
9 changes: 9 additions & 0 deletions packager/utils/clock.cc
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
#import "packager/utils/clock.h"

namespace shaka {

Clock::time_point Clock::now() noexcept {
return std::chrono::system_clock::now();
}

}
2 changes: 1 addition & 1 deletion packager/utils/clock.h
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ class Clock {

virtual ~Clock() = default;

virtual time_point now() noexcept { return std::chrono::system_clock::now(); }
virtual time_point now() noexcept;
};

} // namespace shaka
Expand Down

0 comments on commit 48de724

Please sign in to comment.