-
Notifications
You must be signed in to change notification settings - Fork 895
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Make conditional build possible, with Hanabi as the example.
The goal is to provide a simple recipe that people can imitate to do conditional dependencies. PiperOrigin-RevId: 280158267 Change-Id: I8b2ce02ff734ee053ab029bd07d6a788b0ffe341
- Loading branch information
Showing
12 changed files
with
172 additions
and
43 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,31 +1,29 @@ | ||
set (HANABI_HOME $ENV{HOME}/hanabi-learning-environment) | ||
|
||
add_library(hanabi_learning_environment OBJECT | ||
${HANABI_HOME}/hanabi_lib/canonical_encoders.cc | ||
${HANABI_HOME}/hanabi_lib/canonical_encoders.h | ||
${HANABI_HOME}/hanabi_lib/hanabi_card.cc | ||
${HANABI_HOME}/hanabi_lib/hanabi_card.h | ||
${HANABI_HOME}/hanabi_lib/hanabi_game.cc | ||
${HANABI_HOME}/hanabi_lib/hanabi_game.h | ||
${HANABI_HOME}/hanabi_lib/hanabi_hand.cc | ||
${HANABI_HOME}/hanabi_lib/hanabi_hand.h | ||
${HANABI_HOME}/hanabi_lib/hanabi_history_item.cc | ||
${HANABI_HOME}/hanabi_lib/hanabi_history_item.h | ||
${HANABI_HOME}/hanabi_lib/hanabi_move.cc | ||
${HANABI_HOME}/hanabi_lib/hanabi_move.h | ||
${HANABI_HOME}/hanabi_lib/hanabi_observation.cc | ||
${HANABI_HOME}/hanabi_lib/hanabi_observation.h | ||
${HANABI_HOME}/hanabi_lib/hanabi_state.cc | ||
${HANABI_HOME}/hanabi_lib/hanabi_state.h | ||
${HANABI_HOME}/hanabi_lib/observation_encoder.h | ||
${HANABI_HOME}/hanabi_lib/util.cc | ||
${HANABI_HOME}/hanabi_lib/util.h | ||
hanabi-learning-environment/hanabi_lib/canonical_encoders.cc | ||
hanabi-learning-environment/hanabi_lib/canonical_encoders.h | ||
hanabi-learning-environment/hanabi_lib/hanabi_card.cc | ||
hanabi-learning-environment/hanabi_lib/hanabi_card.h | ||
hanabi-learning-environment/hanabi_lib/hanabi_game.cc | ||
hanabi-learning-environment/hanabi_lib/hanabi_game.h | ||
hanabi-learning-environment/hanabi_lib/hanabi_hand.cc | ||
hanabi-learning-environment/hanabi_lib/hanabi_hand.h | ||
hanabi-learning-environment/hanabi_lib/hanabi_history_item.cc | ||
hanabi-learning-environment/hanabi_lib/hanabi_history_item.h | ||
hanabi-learning-environment/hanabi_lib/hanabi_move.cc | ||
hanabi-learning-environment/hanabi_lib/hanabi_move.h | ||
hanabi-learning-environment/hanabi_lib/hanabi_observation.cc | ||
hanabi-learning-environment/hanabi_lib/hanabi_observation.h | ||
hanabi-learning-environment/hanabi_lib/hanabi_state.cc | ||
hanabi-learning-environment/hanabi_lib/hanabi_state.h | ||
hanabi-learning-environment/hanabi_lib/observation_encoder.h | ||
hanabi-learning-environment/hanabi_lib/util.cc | ||
hanabi-learning-environment/hanabi_lib/util.h | ||
) | ||
|
||
target_include_directories (hanabi_learning_environment PUBLIC ${HANABI_HOME}) | ||
target_include_directories (games PUBLIC ${HANABI_HOME}) | ||
target_include_directories (hanabi_learning_environment PUBLIC hanabi-learning-environment) | ||
target_include_directories (games PUBLIC hanabi-learning-environment) | ||
|
||
add_executable(hanabi_test ../hanabi_test.cc ${OPEN_SPIEL_OBJECTS} | ||
$<TARGET_OBJECTS:tests>) | ||
add_test(hanabi_test hanabi_test) | ||
target_include_directories (hanabi_test PUBLIC ${HANABI_HOME}) | ||
target_include_directories (hanabi_test PUBLIC hanabi-learning-environment) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
# Hanabi | ||
|
||
OpenSpiel can support Hanabi, using the implementation in | ||
https://github.com/deepmind/hanabi-learning-environment. To enable this option, | ||
see `open_spiel/scripts/global_variables.sh`. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
#!/bin/sh | ||
|
||
# Copyright 2019 DeepMind Technologies Ltd. All rights reserved. | ||
# | ||
# Licensed under the Apache License, Version 2.0 (the "License"); | ||
# you may not use this file except in compliance with the License. | ||
# You may obtain a copy of the License at | ||
# | ||
# http://www.apache.org/licenses/LICENSE-2.0 | ||
# | ||
# Unless required by applicable law or agreed to in writing, software | ||
# distributed under the License is distributed on an "AS IS" BASIS, | ||
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
# See the License for the specific language governing permissions and | ||
# limitations under the License. | ||
|
||
# Generates a playthrough for a new game with optional parameters. | ||
# This script exists mainly as a reminder for the command to run. | ||
|
||
# This file contains the global variables that control conditional dependencies. | ||
# It is being used to know whether we should: | ||
# (a) download a dependency (done in install.sh) | ||
# (b) build it and link against it during the `cmake` build process | ||
# | ||
# Note that we do not change the value of the constants if they are already | ||
# defined by an enclosing scope (useful for command line overrides). | ||
|
||
export BUILD_WITH_HANABI=${BUILD_WITH_HANABI:-"OFF"} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters